From 304f528f813beec76acf621ba6df5e3e0cb59eba Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 16 May 2021 16:59:19 +0200 Subject: server: Random role selection. --- tools/sql/schema.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/sql') diff --git a/tools/sql/schema.txt b/tools/sql/schema.txt index 97e8b25..d9502c2 100644 --- a/tools/sql/schema.txt +++ b/tools/sql/schema.txt @@ -31,6 +31,7 @@ CREATE TABLE IF NOT EXISTS games ( scenario TEXT, owner INTEGER, private BOOLEAN, + random BOOLEAN, ctime TIMESTAMP, mtime TIMESTAMP, description TEXT, @@ -45,7 +46,6 @@ CREATE TABLE IF NOT EXISTS players ( user_id INTEGER, game_id INTEGER, role TEXT, - UNIQUE ( game_id, user_id, role ), UNIQUE ( game_id, role ) ); @@ -75,6 +75,12 @@ BEGIN roles.title_id = games.title_id AND games.game_id = new.game_id AND roles.role = new.role ) <> 1 + AND new.role <> 'Random 1' + AND new.role <> 'Random 2' + AND new.role <> 'Random 3' + AND new.role <> 'Random 4' + AND new.role <> 'Random 5' + AND new.role <> 'Random 6' THEN RAISE(ABORT, "Invalid role for that title.") END; END; -- cgit v1.2.3