aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/schema.sql
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-21 18:12:49 +0900
committernsfisis <nsfisis@gmail.com>2024-07-21 18:12:49 +0900
commit2512da7ca57dc4c52900417a50daf4f6f2f74054 (patch)
tree6a4921a9fcd2fe774171795425ba04889c9c8a49 /backend/schema.sql
parente3373eb48b8cd5eef61a59d8ff590db184612294 (diff)
downloadiosdc-japan-2025-albatross-2512da7ca57dc4c52900417a50daf4f6f2f74054.tar.gz
iosdc-japan-2025-albatross-2512da7ca57dc4c52900417a50daf4f6f2f74054.tar.zst
iosdc-japan-2025-albatross-2512da7ca57dc4c52900417a50daf4f6f2f74054.zip
add sqldef and sqlc
Diffstat (limited to 'backend/schema.sql')
-rw-r--r--backend/schema.sql23
1 files changed, 23 insertions, 0 deletions
diff --git a/backend/schema.sql b/backend/schema.sql
new file mode 100644
index 0000000..6a2db2d
--- /dev/null
+++ b/backend/schema.sql
@@ -0,0 +1,23 @@
+CREATE TABLE users (
+ user_id SERIAL PRIMARY KEY,
+ username VARCHAR(64) NOT NULL UNIQUE,
+ display_username VARCHAR(64) NOT NULL,
+ icon_url VARCHAR(255),
+ is_admin BOOLEAN NOT NULL,
+ created_at TIMESTAMP NOT NULL DEFAULT NOW()
+);
+
+CREATE TABLE user_auths (
+ user_auth_id SERIAL PRIMARY KEY,
+ user_id INT NOT NULL,
+ auth_type VARCHAR(16) NOT NULL,
+ password_hash VARCHAR(256),
+ CONSTRAINT fk_user_id FOREIGN KEY(user_id) REFERENCES users(user_id)
+);
+
+CREATE TABLE games (
+ game_id SERIAL PRIMARY KEY,
+ type VARCHAR(255) NOT NULL,
+ created_at TIMESTAMP NOT NULL DEFAULT NOW(),
+ state VARCHAR(255) NOT NULL
+);