BEGIN;
CREATE TABLE IF NOT EXISTS "pk_managers" (
	"playerID"	TEXT,
	"yearID"	NUMERIC,
	"teamID"	TEXT,
	"lgID"	TEXT,
	"inseason"	NUMERIC,
	"G"	NUMERIC,
	"W"	NUMERIC,
	"L"	NUMERIC,
	"rank"	NUMERIC,
	"plyrMgr"	TEXT,
	PRIMARY KEY("playerID","yearID","teamID","inseason"),
	foreign key("playerID") references "people"("playerID"),
	foreign key("teamID") references "teams"("teamID")
);
INSERT INTO "pk_managers" SELECT DISTINCT * FROM "managers";
DROP TABLE "managers";
ALTER TABLE "pk_managers" RENAME TO "managers";
COMMIT;
