lahmanlite/sql/keys/fieldingof.sql

17 lines
408 B
MySQL
Raw Normal View History

2024-01-26 00:48:11 +00:00
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")
2024-01-26 01:49:08 +00:00
foreign key("playerID") references "people"("playerID")
2024-01-26 00:48:11 +00:00
);
INSERT INTO "pk_fieldingof" SELECT DISTINCT * FROM "fieldingof";
DROP TABLE "fieldingof";
ALTER TABLE "pk_fieldingof" RENAME TO "fieldingof";
COMMIT;