move fieldingof

This commit is contained in:
Nick Griffey 2024-01-28 00:17:17 -06:00
parent d8c91e3909
commit 0157dd859a
2 changed files with 14 additions and 16 deletions

View File

@ -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;

View File

@ -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;