Fix db creation scripts for linux

This commit is contained in:
George Kalampokis 2021-10-01 12:36:43 +03:00
parent 91729bab6d
commit 0886424b29
3 changed files with 6 additions and 5 deletions

View File

@ -2,4 +2,5 @@ cd ..
source Docker/dmp-db.env
export $(cut -d= -f1 Docker/dmp-db.env)
psql -d postgres -U postgres -w --set=POSTGRES_USER="$POSTGRES_USER" --set=POSTGRES_PASSWORD="$POSTGRES_PASSWORD" --set=POSTGRES_DB="$POSTGRES_DB" -f main/createDatabase.sql
./initdb.sh
PGPASSWORD=$POSTGRES_PASSWORD psql -d $POSTGRES_DB -U $POSTGRES_USER --set=POSTGRES_USER="$POSTGRES_USER" -f main/dmp-dump.sql;
PGPASSWORD=$POSTGRES_PASSWORD psql --set=ADMIN_USERNAME="$ADMIN_USERNAME" --set=ADMIN_PASSWORD="$ADMIN_PASSWORD" -d $POSTGRES_DB -U $POSTGRES_USER -f main/data-dump.sql;

View File

@ -1,6 +1,6 @@
INSERT INTO public."UserInfo"(email, authorization_level, usertype, userstatus, name, created, additionalinfo) VALUES ('fake@email.org', 1, 1, 0, :'ADMIN_USERNAME', now(), '{}');
INSERT INTO public."Credential" VALUES (uuid_generate_v4(), 0, 5, :'ADMIN_USERNAME', :'ADMIN_PASSWORD', now(), now(), (SELECT public."UserInfo"."id" FROM public."UserInfo" WHERE name = :'ADMIN_USERNAME'), 'dmp');
INSERT INTO public."Credential" VALUES (uuid_generate_v4(), 0, 5, :'ADMIN_USERNAME', 'fake@email.org', :'ADMIN_PASSWORD', now(), now(), (SELECT public."UserInfo"."id" FROM public."UserInfo" WHERE name = :'ADMIN_USERNAME'), 'dmp');
INSERT INTO public."UserRole"("Role", "UserId") VALUES (2, (SELECT public."UserInfo"."id" FROM public."UserInfo" WHERE name = :'ADMIN_USERNAME'));

View File

@ -583,7 +583,7 @@ CREATE TABLE public."EmailConfirmation" (
);
ALTER TABLE public."LoginConfirmationEmail" OWNER TO :POSTGRES_USER;
ALTER TABLE public."EmailConfirmation" OWNER TO :POSTGRES_USER;
--
-- Name: Notification; Type: TABLE; Schema: public; Owner: :POSTGRES_USER
@ -1060,8 +1060,8 @@ ALTER TABLE ONLY public."Lock"
-- Name: LoginConfirmationEmail LoginConfirmationEmail_pkey; Type: CONSTRAINT; Schema: public; Owner: :POSTGRES_USER
--
ALTER TABLE ONLY public."LoginConfirmationEmail"
ADD CONSTRAINT "LoginConfirmationEmail_pkey" PRIMARY KEY ("ID");
ALTER TABLE ONLY public."EmailConfirmation"
ADD CONSTRAINT "EmailConfirmation_pkey" PRIMARY KEY ("ID");
--