From c6908c035c61820e643580f1f06c052af8b71a1e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 21 Nov 2021 19:44:15 +0100 Subject: Add your_turn SQL view. --- tools/sql/schema.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/sql/schema.txt') diff --git a/tools/sql/schema.txt b/tools/sql/schema.txt index dc2bcc6..a7cb6bb 100644 --- a/tools/sql/schema.txt +++ b/tools/sql/schema.txt @@ -246,6 +246,15 @@ CREATE VIEW your_turn_reminder AS AND datetime('now') > datetime(mtime, '+1 hour') ; +DROP VIEW IF EXISTS your_turn; +CREATE VIEW your_turn AS + SELECT game_id, user_id, role + FROM players + JOIN games USING(game_id) + JOIN game_state USING(game_id) + WHERE status=1 AND active IN ( 'All', 'Both', role ) + ; + DROP TRIGGER IF EXISTS no_part_on_active_game; CREATE TRIGGER no_part_on_active_game BEFORE DELETE ON players BEGIN -- cgit v1.2.3