CREATE SCHEMA bigscreen;
CREATE TABLE bigscreen.active_tournament (
- tournament INTEGER NOT NULL REFERENCES tournaments
+ tournament INTEGER NOT NULL PRIMARY KEY REFERENCES tournaments
+);
+CREATE TABLE bigscreen.active_rounds (
+ tournament INTEGER NOT NULL REFERENCES bigscreen.active_tournament,
+ round INTEGER NOT NULL,
+
+ PRIMARY KEY ( tournament, round ),
+ FOREIGN KEY ( tournament, round ) REFERENCES rounds
+);
);