From e6256c972ec68ae5ef45123a7414674c7afa89a1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Jun 2021 17:43:43 +0200 Subject: Split chats into separate table. --- tools/sql/schema.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools') 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; -- cgit v1.2.3