summaryrefslogtreecommitdiff
path: root/tools/sql/schema.txt
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-11-14 17:17:49 +0100
committerTor Andersson <tor@ccxvii.net>2021-11-20 13:14:24 +0100
commitd1318d147297161691f5048e1f2cb4e516159144 (patch)
treef8858e16eece0e4a1bf8deb29548c6421b54df03 /tools/sql/schema.txt
parentf02fb77b1cb34b4622f2c90597ff616d4de65fc5 (diff)
downloadserver-d1318d147297161691f5048e1f2cb4e516159144.tar.gz
Add 'hidden' column to titles for beta-testing games.
Diffstat (limited to 'tools/sql/schema.txt')
-rw-r--r--tools/sql/schema.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/sql/schema.txt b/tools/sql/schema.txt
index 5e80ec6..dc2bcc6 100644
--- a/tools/sql/schema.txt
+++ b/tools/sql/schema.txt
@@ -4,7 +4,8 @@ CREATE TABLE IF NOT EXISTS blacklist_mail ( mail TEXT NOT NULL PRIMARY KEY ) WIT
CREATE TABLE IF NOT EXISTS titles (
title_id TEXT NOT NULL PRIMARY KEY,
title_name TEXT NOT NULL,
- bgg INTEGER
+ bgg INTEGER,
+ hidden BOOLEAN
) WITHOUT ROWID;
CREATE TABLE IF NOT EXISTS roles (
@@ -290,3 +291,12 @@ BEGIN
DELETE FROM last_notified WHERE game_id = old.game_id;
DELETE FROM players WHERE game_id = old.game_id;
END;
+
+DROP VIEW IF EXISTS game_stat_view;
+CREATE VIEW game_stat_view AS
+ SELECT title_id, scenario, result, count(*) AS count
+ FROM game_full_view
+ NATURAL JOIN titles
+ WHERE hidden=0 AND is_solo=0 AND status=2
+ GROUP BY title_name, scenario, result
+ ;