move fieldingof
This commit is contained in:
parent
d8c91e3909
commit
0157dd859a
|
@ -1,16 +0,0 @@
|
||||||
BEGIN;
|
|
||||||
CREATE TABLE IF NOT EXISTS "pk_fieldingof" (
|
|
||||||
"playerID" TEXT,
|
|
||||||
"yearID" NUMERIC,
|
|
||||||
"stint" NUMERIC,
|
|
||||||
"Glf" NUMERIC,
|
|
||||||
"Gcf" NUMERIC,
|
|
||||||
"Grf" NUMERIC,
|
|
||||||
PRIMARY KEY("playerID","yearID","stint")
|
|
||||||
foreign key("playerID") references "people"("playerID")
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO "pk_fieldingof" SELECT DISTINCT * FROM "fieldingof";
|
|
||||||
DROP TABLE "fieldingof";
|
|
||||||
ALTER TABLE "pk_fieldingof" RENAME TO "fieldingof";
|
|
||||||
COMMIT;
|
|
14
sql/load.sql
14
sql/load.sql
|
@ -486,4 +486,18 @@ create table if not exists appearancespost (
|
||||||
);
|
);
|
||||||
|
|
||||||
insert into appearancespost select distinct * from "transformed"."appearancespost";
|
insert into appearancespost select distinct * from "transformed"."appearancespost";
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "fieldingof" (
|
||||||
|
"player" TEXT,
|
||||||
|
"year" NUMERIC,
|
||||||
|
"stint" NUMERIC,
|
||||||
|
"Glf" NUMERIC,
|
||||||
|
"Gcf" NUMERIC,
|
||||||
|
"Grf" NUMERIC,
|
||||||
|
PRIMARY KEY("player","year","stint")
|
||||||
|
foreign key("player") references "people"("ID"),
|
||||||
|
foreign key("year") references "seasons"("year")
|
||||||
|
);
|
||||||
|
|
||||||
|
insert into fieldingof select distinct * from "transformed"."fieldingof";
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
Loading…
Reference in New Issue