aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-30 00:10:40 +0900
committernsfisis <nsfisis@gmail.com>2024-07-30 00:26:52 +0900
commitb6d9ec85c0247251c25c5f1a1f94114e412d196b (patch)
treefe9238a93f3f284e435c1decfd08bce8aa4e1643
parent6d35f66e3502b61c0386f719d3a5f3caf0e109b6 (diff)
downloadphperkaigi-2025-albatross-b6d9ec85c0247251c25c5f1a1f94114e412d196b.tar.gz
phperkaigi-2025-albatross-b6d9ec85c0247251c25c5f1a1f94114e412d196b.tar.zst
phperkaigi-2025-albatross-b6d9ec85c0247251c25c5f1a1f94114e412d196b.zip
fix(backend): add unique constraint to user_auths.user_id
-rw-r--r--backend/schema.sql2
1 files changed, 1 insertions, 1 deletions
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)