From 223891066ab3f727f2270e3674d93888405ca4d5 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sat, 15 Mar 2025 21:44:10 +0900
Subject: feat(backen): allow admin to edit main players

---
 backend/query.sql | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'backend/query.sql')

diff --git a/backend/query.sql b/backend/query.sql
index e81a11b..61175ab 100644
--- a/backend/query.sql
+++ b/backend/query.sql
@@ -79,6 +79,14 @@ JOIN users ON game_main_players.user_id = users.user_id
 WHERE game_main_players.game_id = ANY($1::INT[])
 ORDER BY game_main_players.user_id;
 
+-- name: AddMainPlayer :exec
+INSERT INTO game_main_players (game_id, user_id)
+VALUES ($1, $2);
+
+-- name: RemoveAllMainPlayers :exec
+DELETE FROM game_main_players
+WHERE game_id = $1;
+
 -- name: ListTestcasesByGameID :many
 SELECT * FROM testcases
 WHERE testcases.problem_id = (SELECT problem_id FROM games WHERE game_id = $1)
-- 
cgit v1.3.1

