UNIQUE ( title )
);
+CREATE TABLE songshorttitles (
+ song INTEGER NOT NULL REFERENCES songs,
+ shorttitle VARCHAR NOT NULL,
+
+ PRIMARY KEY ( song, shorttitle ),
+ UNIQUE ( shorttitle )
+);
+
CREATE TABLE machinesongs (
song INTEGER NOT NULL REFERENCES songs,
machine INTEGER NOT NULL REFERENCES machines,
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_groups (
+ tournament INTEGER NOT NULL REFERENCES bigscreen.active_tournament,
+ round INTEGER NOT NULL,
+ parallel INTEGER NOT NULL,
+
+ PRIMARY KEY ( tournament, round, parallel ),
+ FOREIGN KEY ( tournament, round, parallel ) REFERENCES groups
+);
);