mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
чиним билд16
This commit is contained in:
@@ -1,8 +1,27 @@
|
|||||||
-- Create database
|
|
||||||
CREATE DATABASE support_db;
|
|
||||||
|
|
||||||
-- Connect to the database
|
-- Connect to the database
|
||||||
\c support_db;
|
\c support_db;
|
||||||
|
|
||||||
-- Create extensions if needed
|
-- Create extensions if needed
|
||||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||||
|
|
||||||
|
-- Create tables if they don't exist
|
||||||
|
CREATE TABLE IF NOT EXISTS employees (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
first_name VARCHAR NOT NULL,
|
||||||
|
last_name VARCHAR NOT NULL,
|
||||||
|
department VARCHAR NOT NULL,
|
||||||
|
office VARCHAR NOT NULL,
|
||||||
|
password VARCHAR NOT NULL,
|
||||||
|
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS requests (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
employee_id INTEGER REFERENCES employees(id),
|
||||||
|
department VARCHAR NOT NULL,
|
||||||
|
request_type VARCHAR NOT NULL,
|
||||||
|
priority VARCHAR NOT NULL,
|
||||||
|
description TEXT NOT NULL,
|
||||||
|
status VARCHAR NOT NULL DEFAULT 'new',
|
||||||
|
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
@@ -28,9 +28,10 @@ services:
|
|||||||
image: postgres:15
|
image: postgres:15
|
||||||
container_name: support-postgres
|
container_name: support-postgres
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=postgres
|
POSTGRES_USER: postgres
|
||||||
- POSTGRES_PASSWORD=postgres123
|
POSTGRES_PASSWORD: postgres123
|
||||||
- POSTGRES_DB=support_db
|
POSTGRES_DB: support_db
|
||||||
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
- ./backend/docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./backend/docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
|||||||
Reference in New Issue
Block a user