17 lines
408 B
PL/PgSQL
17 lines
408 B
PL/PgSQL
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;
|