From ff4bc953f16002befbd6cf8dd120a96cfeca26fe Mon Sep 17 00:00:00 2001
From: Tor Andersson <tor@ccxvii.net>
Date: Wed, 8 Jun 2022 21:53:40 +0200
Subject: Allow users to leave and join active games.

Add "Need replacement" list of games.
---
 schema.sql | 22 ----------------------
 1 file changed, 22 deletions(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 14912d0..a5ec561 100644
--- a/schema.sql
+++ b/schema.sql
@@ -387,28 +387,6 @@ create view your_turn as
 		and active in ('All', 'Both', role)
 	;
 
--- Triggers --
-
-drop trigger if exists no_part_on_active_game;
-create trigger no_part_on_active_game before delete on players
-begin
-	select
-		raise(abort, 'Cannot remove players from started games.')
-	where
-		(select status from games where games.game_id = old.game_id) > 0
-	;
-end;
-
-drop trigger if exists no_join_on_active_game;
-create trigger no_join_on_active_game before insert on players
-begin
-	select
-		raise(abort, 'Cannot add players to started games.')
-	where
-		(select status from games where games.game_id = new.game_id) > 0
-	;
-end;
-
 -- Manual key management if pragma foreign_keys = off
 drop trigger if exists trigger_delete_on_games;
 create trigger trigger_delete_on_games after delete on games
-- 
cgit v1.2.3

