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