use seriespost as foreign key
This commit is contained in:
parent
8f519b8437
commit
c22af98eb9
|
@ -406,7 +406,7 @@ CREATE TABLE IF NOT EXISTS "battingpost" (
|
||||||
"GIDP" NUMERIC,
|
"GIDP" NUMERIC,
|
||||||
PRIMARY KEY("year","player","round"),
|
PRIMARY KEY("year","player","round"),
|
||||||
foreign key("player") references "people"("ID"),
|
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";
|
insert into battingpost select distinct * from "transformed"."battingpost";
|
||||||
|
@ -429,7 +429,7 @@ CREATE TABLE IF NOT EXISTS "fieldingpost" (
|
||||||
"CS" NUMERIC,
|
"CS" NUMERIC,
|
||||||
PRIMARY KEY("player","year","round","POS"),
|
PRIMARY KEY("player","year","round","POS"),
|
||||||
foreign key("player") references "people"("ID"),
|
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";
|
insert into fieldingpost select distinct * from "transformed"."fieldingpost";
|
||||||
|
@ -465,7 +465,7 @@ CREATE TABLE IF NOT EXISTS "pitchingpost" (
|
||||||
"GIDP" NUMERIC,
|
"GIDP" NUMERIC,
|
||||||
PRIMARY KEY("player","year","round"),
|
PRIMARY KEY("player","year","round"),
|
||||||
foreign key("player") references "people"("ID"),
|
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";
|
insert into pitchingpost select distinct * from "transformed"."pitchingpost";
|
||||||
|
|
Loading…
Reference in New Issue