Skip to content

Commit

Permalink
fix(docker): postgres correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Pipazoul committed Nov 28, 2023
1 parent adb2e3b commit fa7f8b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ services:
- POSTGRES_USER=${BDD_CONFIG_USER}
- POSTGRES_PASSWORD=${BDD_CONFIG_PASSWD}
- POSTGRES_DB=${BDD_CONFIG_DB}
- POSTGRES_SCHEMA=${BDD_CONFIG_SCHEMA}
volumes:
- ./sql:/sql
- ./postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
Expand Down
12 changes: 2 additions & 10 deletions sql/create-tables.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

DROP SCHEMA IF EXISTS base CASCADE;

CREATE SCHEMA base AUTHORIZATION adm;
CREATE SCHEMA base;


-- ##################################################################
Expand All @@ -10,14 +10,11 @@ CREATE SCHEMA base AUTHORIZATION adm;


CREATE TYPE base.roles_auth AS ENUM ('SUPERADMIN', 'ADMIN', 'USER');
ALTER TYPE base.roles_auth OWNER TO adm;


CREATE TYPE base.status_auth AS ENUM ('INACTIVE', 'ACTIVE', 'BANNED', 'PENDING');
ALTER TYPE base.status_auth OWNER TO adm;

CREATE TYPE base.img_type AS ENUM ('png', 'gif', 'jpg', 'jpeg');
ALTER TYPE base.img_type OWNER TO adm;

-- ##################################################################
-- # TABLES #
Expand All @@ -32,7 +29,6 @@ CREATE TABLE base.authentications (
role base.roles_auth NOT NULL DEFAULT 'USER'::base.roles_auth,
status base.status_auth NOT NULL DEFAULT 'ACTIVE'::base.status_auth
);
ALTER TABLE base.authentications OWNER TO adm;

CREATE TABLE base.users (
id serial PRIMARY KEY,
Expand All @@ -46,7 +42,6 @@ CREATE TABLE base.users (
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
ALTER TABLE base.users OWNER TO adm;

CREATE TABLE base.documents (
id serial PRIMARY KEY,
Expand All @@ -61,7 +56,6 @@ CREATE TABLE base.documents (
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
ALTER TABLE base.documents OWNER TO adm;

CREATE TABLE base.projects (
id serial PRIMARY KEY,
Expand All @@ -87,7 +81,6 @@ CREATE TABLE base.projects (
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
ALTER TABLE base.projects OWNER TO adm;

CREATE TABLE base.datas (
id serial PRIMARY KEY,
Expand All @@ -104,5 +97,4 @@ CREATE TABLE base.datas (
REFERENCES base.projects (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
ALTER TABLE base.datas OWNER TO adm;
);

0 comments on commit fa7f8b2

Please sign in to comment.