Skip to content

Commit

Permalink
db: changed name of role.role on role.name, changed timestampz and de…
Browse files Browse the repository at this point in the history
…leted some not nulls.
  • Loading branch information
rogacky11 committed Mar 25, 2024
1 parent f3c981b commit f62891b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ POSTGRES_CLIENT_PASSWORD=sql
# PGADMIN
PGADMIN_LISTEN_PORT=5050
PGADMIN_DEFAULT_EMAIL=[email protected]
PGADMIN_DEFAULT_PASSWORD=sql
PGADMIN_DEFAULT_PASSWORD=sql
10 changes: 5 additions & 5 deletions Database/init-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CREATE TABLE IF NOT EXISTS events.event (
);

CREATE TABLE IF NOT EXISTS events.participant (
"id" SERIAL PRIMARY KEY NOT NULL,
"id" SERIAL PRIMARY KEY,
"event_id" integer NOT NULL,
"user_id" integer NOT NULL,
"status_id" integer NOT NULL
Expand Down Expand Up @@ -66,15 +66,15 @@ CREATE TABLE IF NOT EXISTS events.event_parameter (
);

CREATE TABLE IF NOT EXISTS users.role (
"id" SERIAL PRIMARY KEY NOT NULL,
"role" varchar(255) NOT NULL
"id" SERIAL PRIMARY KEY,
"name" varchar(255) NOT NULL
);

CREATE TABLE IF NOT EXISTS events.comment (
"id" SERIAL PRIMARY KEY,
"event_id" integer NOT NULL,
"content" varchar(255) NOT NULL,
"created_at" date NOT NULL,
"created_at" timestamptz NOT NULL,
"user_id" integer NOT NULL
);

Expand Down Expand Up @@ -146,7 +146,7 @@ ALTER TABLE events.event ADD FOREIGN KEY ("status_id") REFERENCES common.status

ALTER TABLE users.user_interest ADD FOREIGN KEY ("interest_id") REFERENCES users.interest ("id");

INSERT INTO users.role ("id", "role") VALUES
INSERT INTO users.role ("id", "name") VALUES
(1, 'Użytkownik'),
(2, 'Organizator'),
(3, 'Admin');
Expand Down
7 changes: 1 addition & 6 deletions docker-compose.override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ services:
- "5432:5432"

volumes:
- ./database/init-dev-data.sql:/docker-entrypoint-initdb.d/init-dev-data.sql





- ./Database/init-dev-data.sql:/docker-entrypoint-initdb.d/04_init-dev-data.sql
9 changes: 3 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ services:
- reasn-network
volumes:
- postgres-data:/var/lib/postgresql/data
- ./Database/init-tables-values.sql:/docker-entrypoint-initdb.d/01_init-tables-values.sql
- ./Database/init-func-object-id.sql:/docker-entrypoint-initdb.d/02_init-func-object-id.sql
- ./Database/init-user-db.sh:/docker-entrypoint-initdb.d/03_init-user-db.sh
- ./Database/init-db.sql:/docker-entrypoint-initdb.d/01_init-db.sql
- ./Database/init-constraints.sql:/docker-entrypoint-initdb.d/02_init-constraints.sql
- ./Database/init-users.sh:/docker-entrypoint-initdb.d/03_init-users.sh
env_file:
- .env
- .env.sample

pgadmin:
image: dpage/pgadmin4:8.0
Expand All @@ -34,5 +33,3 @@ networks:
volumes:
postgres-data:
pgadmin-data:


0 comments on commit f62891b

Please sign in to comment.