19 lines
409 B
PL/PgSQL
19 lines
409 B
PL/PgSQL
BEGIN;
|
|
CREATE TABLE IF NOT EXISTS "pk_seriespost" (
|
|
"yearID" NUMERIC,
|
|
"round" NUMERIC,
|
|
"teamIDwinner" TEXT,
|
|
"lgIDwinner" TEXT,
|
|
"teamIDloser" TEXT,
|
|
"lgIDloser" TEXT,
|
|
"wins" NUMERIC,
|
|
"losses" NUMERIC,
|
|
"ties" NUMERIC,
|
|
PRIMARY KEY("yearID","round")
|
|
);
|
|
|
|
INSERT INTO "pk_seriespost" SELECT DISTINCT * FROM "seriespost";
|
|
DROP TABLE "seriespost";
|
|
ALTER TABLE "pk_seriespost" RENAME TO "seriespost";
|
|
COMMIT;
|