UNIQUE ( title )
);
--- CREATE TABLE machinesongs etc.
+CREATE TABLE machinesongs (
+ song INTEGER NOT NULL REFERENCES songs,
+ machine INTEGER NOT NULL REFERENCES machines,
+
+ PRIMARY KEY ( song, machine )
+);
CREATE TABLE scoringsystems (
scoringsystem SERIAL PRIMARY KEY,
FOREIGN KEY (tournament, round, parallel, player) REFERENCES roundparticipation (tournament, round, parallel, player),
PRIMARY KEY (tournament, round, parallel, player, songnumber)
);
+
+CREATE TABLE randomsongsused (
+ song INTEGER NOT NULL PRIMARY KEY REFERENCES songs
+);