From 29a4e5bb228778db9c6c35aad544547b08c74da3 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Mon, 23 Feb 2026 22:36:07 +0000 Subject: [PATCH] feat: add database schema --- db/schema.sql | 7 +++++++ docker-compose.yml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/schema.sql diff --git a/db/schema.sql b/db/schema.sql new file mode 100644 index 0000000..c28a10c --- /dev/null +++ b/db/schema.sql @@ -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 +); \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 3e36563..dec2007 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,8 @@ services: ports: - "5432:5432" volumes: - - postgres_data:/var/lib/postgresql/data + - ./db/postgres_vol:/var/lib/postgresql/data + - ./db/schema.sql:/docker-entrypoint-initdb.d/schema.sql volumes: postgres_data: \ No newline at end of file