summaryrefslogtreecommitdiff
path: root/tools/sql
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sql')
-rw-r--r--tools/sql/schema.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/sql/schema.txt b/tools/sql/schema.txt
index 227d861..a75ce1d 100644
--- a/tools/sql/schema.txt
+++ b/tools/sql/schema.txt
@@ -7,7 +7,15 @@ CREATE TABLE IF NOT EXISTS users (
ctime TIMESTAMP,
cip TEXT,
atime TIMESTAMP,
- aip TEXT
+ aip TEXT,
+ notifications INTEGER
+);
+
+CREATE TABLE IF NOT EXISTS notifications (
+ user_id INTEGER,
+ game_id INTEGER,
+ time TIMESTAMP,
+ UNIQUE ( user_id, game_id )
);
CREATE TABLE IF NOT EXISTS blacklist_ip ( ip TEXT PRIMARY KEY );
@@ -89,4 +97,5 @@ DROP TRIGGER IF EXISTS purge_players;
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;
END;