feat: add database schema

This commit is contained in:
2026-02-23 22:36:07 +00:00
parent dc919681fd
commit 29a4e5bb22
2 changed files with 9 additions and 1 deletions

7
db/schema.sql Normal file
View File

@@ -0,0 +1,7 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

View File

@@ -8,7 +8,8 @@ services:
ports: ports:
- "5432:5432" - "5432:5432"
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - ./db/postgres_vol:/var/lib/postgresql/data
- ./db/schema.sql:/docker-entrypoint-initdb.d/schema.sql
volumes: volumes:
postgres_data: postgres_data: