From b6d9ec85c0247251c25c5f1a1f94114e412d196b Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Tue, 30 Jul 2024 00:10:40 +0900
Subject: fix(backend): add unique constraint to user_auths.user_id

---
 backend/schema.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'backend/schema.sql')

diff --git a/backend/schema.sql b/backend/schema.sql
index 2a92271..3a4422f 100644
--- a/backend/schema.sql
+++ b/backend/schema.sql
@@ -9,7 +9,7 @@ CREATE TABLE users (
 
 CREATE TABLE user_auths (
     user_auth_id  SERIAL      PRIMARY KEY,
-    user_id       INT         NOT NULL,
+    user_id       INT         NOT NULL UNIQUE,
     auth_type     VARCHAR(16) NOT NULL,
     password_hash VARCHAR(256),
     CONSTRAINT fk_user_id FOREIGN KEY(user_id) REFERENCES users(user_id)
-- 
cgit v1.3.1

