Schema for games
CREATE TABLE unplayed_games (
game_id TEXT PRIMARY KEY
);
CREATE TABLE dim_date (
date TEXT PRIMARY KEY,
season TEXT,
season_phase TEXT);
CREATE TABLE "season" (
"season" TEXT NOT NULL,
"current_yn" TEXT,
PRIMARY KEY("season")
);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE "conference" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(16) NULL);
CREATE TABLE "arena" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "Arena" varchar(64) NOT NULL, "Latitude" integer NULL, "Longitude" integer NULL, "Capacity" integer NULL, "Opened" integer NULL, "Closed" integer NULL, "Team" bigint NULL REFERENCES "team" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE INDEX "arena_Team_bcb54805" ON "arena" ("Team");
CREATE TABLE "division" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(16) NULL, "conference_id" bigint NULL REFERENCES "conference" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE INDEX "division_conference_id_353b5fb4" ON "division" ("conference_id");
CREATE TABLE "team" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(32) NULL, "year_founded" integer NULL, "division_id" bigint NULL REFERENCES "division" ("id") DEFERRABLE INITIALLY DEFERRED, "franchise_id" bigint NULL REFERENCES "franchise" ("id") DEFERRABLE INITIALLY DEFERRED);
CREATE INDEX "team_division_id_d045beb7" ON "team" ("division_id");
CREATE TABLE "franchise" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "Franchise" varchar(64) NOT NULL, "Year_Founded" integer NULL);
CREATE INDEX "team_franchise_id_c7da83a8" ON "team" ("franchise_id");
CREATE TABLE "games" (
"game_id" TEXT,
"away_team" TEXT,
"away_team_score" INTEGER,
"home_team" TEXT,
"home_team_score" INTEGER,
"game_status" TEXT,
"game_date" TEXT,
"game_attendance" INTEGER,
"home_team_shots" INTEGER,
"away_team_shots" INTEGER,
PRIMARY KEY("game_id")
);
CREATE TABLE "team_date_point" (
"id" INTEGER,
"team_id" INTEGER,
"date" INTEGER,
"wins" INTEGER,
"loses" INTEGER,
"otl" INTEGER,
"sol" INTEGER,
"total_points" INTEGER,
UNIQUE("team_id","date"),
PRIMARY KEY("id" AUTOINCREMENT)
)