summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-26 17:43:43 +0200
committerTor Andersson <tor@ccxvii.net>2021-06-26 22:38:12 +0200
commite6256c972ec68ae5ef45123a7414674c7afa89a1 (patch)
treeca9d9ac3c76b278854b94dd46b3ec9ada3b90dd5 /tools
parent4ce29d476a39f7fd226e49ed33fdd3e1f0882e13 (diff)
downloadserver-e6256c972ec68ae5ef45123a7414674c7afa89a1.tar.gz
Split chats into separate table.
Diffstat (limited to 'tools')
-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 57e369e..2f84e82 100644
--- a/tools/sql/schema.txt
+++ b/tools/sql/schema.txt
@@ -52,7 +52,12 @@ CREATE TABLE IF NOT EXISTS games (
status INTEGER,
result TEXT,
active TEXT,
- state TEXT,
+ state TEXT
+);
+
+CREATE TABLE IF NOT EXISTS chats (
+ game_id INTEGER PRIMARY KEY,
+ time TIMESTAMP,
chat TEXT
);
@@ -104,4 +109,5 @@ CREATE TRIGGER purge_players AFTER DELETE ON games
BEGIN
DELETE FROM players WHERE game_id = old.game_id;
DELETE FROM notifications WHERE game_id = old.game_id;
+ DELETE FROM chats WHERE game_id = old.game_id;
END;