From 3f2c801b616f4c23c28c03d938bbadefefb49eb0 Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor@ccxvii.net>
Date: Sat, 23 Nov 2024 12:17:25 +0100
Subject: Pause inactive users from tournament queue.

Remove very inactive users from tournament queue.

Count tournaments as "open" while they still have players queued.
---
 schema.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index e945916..4ae8bb5 100644
--- a/schema.sql
+++ b/schema.sql
@@ -632,6 +632,17 @@ create table if not exists tm_winners (
 
 create index if not exists tm_winners_pool_idx on tm_winners(pool_id);
 
+drop view if exists tm_queue_view;
+create view tm_queue_view as
+	select
+		tm_queue.*
+	from
+		tm_queue
+		join user_last_seen using(user_id)
+	where
+		julianday() - julianday(atime) < 3
+	;
+
 drop view if exists tm_pool_active_view;
 create view tm_pool_active_view as
 	select
-- 
cgit v1.2.3

