lahmanlite/sql/keys/awardsplayers.sql

17 lines
437 B
MySQL
Raw Normal View History

2024-01-26 01:28:46 +00:00
BEGIN;
CREATE TABLE IF NOT EXISTS "pk_awardsplayers" (
"playerID" TEXT,
"awardID" TEXT,
"yearID" NUMERIC,
"lgID" TEXT,
"tie" TEXT,
"notes" TEXT,
2024-01-26 01:49:08 +00:00
PRIMARY KEY("awardID","yearID","lgID","notes","playerID"),
foreign key("playerID") references "people"("playerID")
2024-01-26 01:28:46 +00:00
);
INSERT INTO "pk_awardsplayers" SELECT DISTINCT * FROM "awardsplayers";
DROP TABLE "awardsplayers";
ALTER TABLE "pk_awardsplayers" RENAME TO "awardsplayers";
COMMIT;