From c89a53e7cab4da7cb4513b032beee26195c49ba9 Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor@ccxvii.net>
Date: Wed, 12 Feb 2025 00:43:24 +0100
Subject: Track all game timeouts.

---
 schema.sql | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 041761b..2756901 100644
--- a/schema.sql
+++ b/schema.sql
@@ -69,6 +69,15 @@ create table if not exists user_last_seen (
 	ip text
 );
 
+create table if not exists user_timeout (
+	user_id integer,
+	game_id integer,
+	time datetime default current_timestamp,
+	primary key (user_id, game_id)
+);
+
+create index if not exists user_timeout_idx on user_timeout(user_id, time);
+
 create table if not exists tokens (
 	user_id integer primary key,
 	token text,
@@ -607,12 +616,6 @@ create table if not exists tm_banned (
 	time datetime default current_timestamp
 );
 
-create table if not exists tm_timeout (
-	user_id integer,
-	game_id integer,
-	time datetime default current_timestamp
-);
-
 create table if not exists tm_queue (
 	user_id integer,
 	seed_id integer,
-- 
cgit v1.2.3

