2024-01-26 00:48:11 +00:00
|
|
|
BEGIN;
|
|
|
|
CREATE TABLE IF NOT EXISTS "pk_teams" (
|
|
|
|
"yearID" NUMERIC,
|
|
|
|
"lgID" TEXT,
|
|
|
|
"teamID" TEXT,
|
|
|
|
"franchID" TEXT,
|
|
|
|
"divID" TEXT,
|
|
|
|
"Rank" NUMERIC,
|
|
|
|
"G" NUMERIC,
|
|
|
|
"Ghome" NUMERIC,
|
|
|
|
"W" NUMERIC,
|
|
|
|
"L" NUMERIC,
|
|
|
|
"DivWin" NUMERIC,
|
|
|
|
"WCWin" NUMERIC,
|
|
|
|
"LgWin" NUMERIC,
|
|
|
|
"WSWin" NUMERIC,
|
|
|
|
"R" NUMERIC,
|
|
|
|
"AB" NUMERIC,
|
|
|
|
"H" NUMERIC,
|
|
|
|
"2B" NUMERIC,
|
|
|
|
"3B" NUMERIC,
|
|
|
|
"HR" NUMERIC,
|
|
|
|
"BB" NUMERIC,
|
|
|
|
"SO" NUMERIC,
|
|
|
|
"SB" NUMERIC,
|
|
|
|
"CS" NUMERIC,
|
|
|
|
"HBP" NUMERIC,
|
|
|
|
"SF" NUMERIC,
|
|
|
|
"RA" NUMERIC,
|
|
|
|
"ER" NUMERIC,
|
|
|
|
"ERA" NUMERIC,
|
|
|
|
"CG" NUMERIC,
|
|
|
|
"SHO" NUMERIC,
|
|
|
|
"SV" NUMERIC,
|
|
|
|
"IPouts" NUMERIC,
|
|
|
|
"HA" NUMERIC,
|
|
|
|
"HRA" NUMERIC,
|
|
|
|
"BBA" NUMERIC,
|
|
|
|
"SOA" NUMERIC,
|
|
|
|
"E" NUMERIC,
|
|
|
|
"DP" NUMERIC,
|
|
|
|
"FP" NUMERIC,
|
|
|
|
"name" NUMERIC,
|
|
|
|
"park" NUMERIC,
|
|
|
|
"attendance" NUMERIC,
|
|
|
|
"BPF" NUMERIC,
|
|
|
|
"PPF" NUMERIC,
|
|
|
|
"teamIDBR" TEXT,
|
|
|
|
"teamIDlahman45" TEXT,
|
|
|
|
"teamIDretro" TEXT,
|
2024-01-26 01:49:08 +00:00
|
|
|
PRIMARY KEY("yearID","teamID"),
|
|
|
|
foreign key("franchID") references "teamsfranchises"("franchID")
|
2024-01-26 00:48:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
INSERT INTO "pk_teams" SELECT DISTINCT * FROM "teams";
|
|
|
|
DROP TABLE "teams";
|
|
|
|
ALTER TABLE "pk_teams" RENAME TO "teams";
|
|
|
|
COMMIT;
|