From d85cf0be57dd4394c588c340fbfa8483d981da02 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sun, 28 Jul 2024 15:58:34 +0900
Subject: feat(backend): add game_players table

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

(limited to 'backend/schema.sql')

diff --git a/backend/schema.sql b/backend/schema.sql
index 1cd0700..f0b5b37 100644
--- a/backend/schema.sql
+++ b/backend/schema.sql
@@ -26,6 +26,14 @@ CREATE TABLE games (
     CONSTRAINT fk_problem_id FOREIGN KEY(problem_id) REFERENCES problems(problem_id)
 );
 
+CREATE TABLE game_players (
+    game_id INT NOT NULL,
+    user_id INT NOT NULL,
+    PRIMARY KEY (game_id, user_id),
+    CONSTRAINT fk_game_id FOREIGN KEY(game_id) REFERENCES games(game_id),
+    CONSTRAINT fk_user_id FOREIGN KEY(user_id) REFERENCES users(user_id)
+);
+
 CREATE TABLE problems (
     problem_id  SERIAL       PRIMARY KEY,
     title       VARCHAR(255) NOT NULL,
-- 
cgit v1.3.1

