This commit is contained in:
2026-02-04 20:29:42 -06:00
parent e37c64fb1d
commit 515ddb24d6
18 changed files with 921 additions and 19 deletions

View File

@@ -0,0 +1,13 @@
CREATE TYPE "public"."match_status" AS ENUM('scheduled', 'live', 'finished');--> statement-breakpoint
CREATE TABLE "matches" (
"id" serial PRIMARY KEY NOT NULL,
"sport" text NOT NULL,
"home_team" text NOT NULL,
"away_team" text NOT NULL,
"status" "match_status" DEFAULT 'scheduled' NOT NULL,
"start_time" timestamp,
"end_time" timestamp,
"home_score" integer DEFAULT 0 NOT NULL,
"away_score" integer DEFAULT 0 NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);

View File

@@ -0,0 +1,3 @@
CREATE TABLE "commentary" (
"id" serial PRIMARY KEY NOT NULL
);

View File

@@ -0,0 +1,12 @@
ALTER TABLE "commentary" ADD COLUMN "match_id" integer NOT NULL;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "minute" integer;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "sequence" integer;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "period" text;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "event_type" text;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "actor" text;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "team" text;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "message" text NOT NULL;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "metadata" jsonb;--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "tags" text[];--> statement-breakpoint
ALTER TABLE "commentary" ADD COLUMN "created_at" timestamp DEFAULT now() NOT NULL;--> statement-breakpoint
ALTER TABLE "commentary" ADD CONSTRAINT "commentary_match_id_matches_id_fk" FOREIGN KEY ("match_id") REFERENCES "public"."matches"("id") ON DELETE no action ON UPDATE no action;

View File

@@ -0,0 +1,107 @@
{
"id": "cc319841-30d4-4928-ba5c-fe3352ba1bf8",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.matches": {
"name": "matches",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"sport": {
"name": "sport",
"type": "text",
"primaryKey": false,
"notNull": true
},
"home_team": {
"name": "home_team",
"type": "text",
"primaryKey": false,
"notNull": true
},
"away_team": {
"name": "away_team",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "match_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'scheduled'"
},
"start_time": {
"name": "start_time",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"end_time": {
"name": "end_time",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"home_score": {
"name": "home_score",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"away_score": {
"name": "away_score",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.match_status": {
"name": "match_status",
"schema": "public",
"values": [
"scheduled",
"live",
"finished"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View File

@@ -0,0 +1,126 @@
{
"id": "919e2530-f5a0-4aab-8a61-b4a3bacad982",
"prevId": "cc319841-30d4-4928-ba5c-fe3352ba1bf8",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.commentary": {
"name": "commentary",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.matches": {
"name": "matches",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"sport": {
"name": "sport",
"type": "text",
"primaryKey": false,
"notNull": true
},
"home_team": {
"name": "home_team",
"type": "text",
"primaryKey": false,
"notNull": true
},
"away_team": {
"name": "away_team",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "match_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'scheduled'"
},
"start_time": {
"name": "start_time",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"end_time": {
"name": "end_time",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"home_score": {
"name": "home_score",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"away_score": {
"name": "away_score",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.match_status": {
"name": "match_status",
"schema": "public",
"values": [
"scheduled",
"live",
"finished"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View File

@@ -0,0 +1,207 @@
{
"id": "0e98917e-e04a-4424-aa92-9c66371c9960",
"prevId": "919e2530-f5a0-4aab-8a61-b4a3bacad982",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.commentary": {
"name": "commentary",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"match_id": {
"name": "match_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"minute": {
"name": "minute",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"sequence": {
"name": "sequence",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"period": {
"name": "period",
"type": "text",
"primaryKey": false,
"notNull": false
},
"event_type": {
"name": "event_type",
"type": "text",
"primaryKey": false,
"notNull": false
},
"actor": {
"name": "actor",
"type": "text",
"primaryKey": false,
"notNull": false
},
"team": {
"name": "team",
"type": "text",
"primaryKey": false,
"notNull": false
},
"message": {
"name": "message",
"type": "text",
"primaryKey": false,
"notNull": true
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"tags": {
"name": "tags",
"type": "text[]",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"commentary_match_id_matches_id_fk": {
"name": "commentary_match_id_matches_id_fk",
"tableFrom": "commentary",
"tableTo": "matches",
"columnsFrom": [
"match_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.matches": {
"name": "matches",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"sport": {
"name": "sport",
"type": "text",
"primaryKey": false,
"notNull": true
},
"home_team": {
"name": "home_team",
"type": "text",
"primaryKey": false,
"notNull": true
},
"away_team": {
"name": "away_team",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "match_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'scheduled'"
},
"start_time": {
"name": "start_time",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"end_time": {
"name": "end_time",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"home_score": {
"name": "home_score",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"away_score": {
"name": "away_score",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.match_status": {
"name": "match_status",
"schema": "public",
"values": [
"scheduled",
"live",
"finished"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View File

@@ -0,0 +1,27 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1770045471965,
"tag": "0000_slim_shiva",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1770045929269,
"tag": "0001_dark_ben_grimm",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1770060258034,
"tag": "0002_careless_franklin_richards",
"breakpoints": true
}
]
}