diff options
Diffstat (limited to 'tools/sql/schema.txt')
-rw-r--r-- | tools/sql/schema.txt | 9 |
1 files changed, 9 insertions, 0 deletions
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 |