summaryrefslogtreecommitdiff
path: root/tools/sql
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-05-16 16:59:19 +0200
committerTor Andersson <tor@ccxvii.net>2021-05-16 17:02:44 +0200
commit304f528f813beec76acf621ba6df5e3e0cb59eba (patch)
tree0004cd3ed17482d9e4020c4874281de6c1a59382 /tools/sql
parent0247427e0351080e96cc97ab75a8bc614b6b20bd (diff)
downloadserver-304f528f813beec76acf621ba6df5e3e0cb59eba.tar.gz
server: Random role selection.
Diffstat (limited to 'tools/sql')
-rw-r--r--tools/sql/schema.txt8
1 files changed, 7 insertions, 1 deletions
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;