use seriespost as foreign key

This commit is contained in:
Nick Griffey 2024-01-29 22:03:44 -06:00
parent 8f519b8437
commit c22af98eb9
1 changed files with 3 additions and 3 deletions

View File

@ -406,7 +406,7 @@ CREATE TABLE IF NOT EXISTS "battingpost" (
"GIDP" NUMERIC,
PRIMARY KEY("year","player","round"),
foreign key("player") references "people"("ID"),
foreign key("year") references "seasons"("year")
foreign key("year","round") references "seriespost"("year","round")
);
insert into battingpost select distinct * from "transformed"."battingpost";
@ -429,7 +429,7 @@ CREATE TABLE IF NOT EXISTS "fieldingpost" (
"CS" NUMERIC,
PRIMARY KEY("player","year","round","POS"),
foreign key("player") references "people"("ID"),
foreign key("year") references "seasons"("year")
foreign key("year","round") references "seriespost"("year","round")
);
insert into fieldingpost select distinct * from "transformed"."fieldingpost";
@ -465,7 +465,7 @@ CREATE TABLE IF NOT EXISTS "pitchingpost" (
"GIDP" NUMERIC,
PRIMARY KEY("player","year","round"),
foreign key("player") references "people"("ID"),
foreign key("year") references "seasons"("year")
foreign key("year","round") references "seriespost"("year","round")
);
insert into pitchingpost select distinct * from "transformed"."pitchingpost";