From 5d6fbd3e3713836b669df8521e1a39561930541a Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 4 May 2020 17:15:52 +0300 Subject: [PATCH] Improve self deployment --- .../config/application-staging.properties | 16 +++++++------ .../08/07_Remove_no_null_requirement.sql | 2 ++ .../08/08_create_datasetexternaldataset.sql | 19 +++++++++++++++ .../updates/08/09_Create_Invitation.sql | 23 +++++++++++++++++++ .../updates/08/10_Create_User_preference.sql | 16 +++++++++++++ docker-compose.yml | 1 + 6 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 dmp-db-scema/updates/08/07_Remove_no_null_requirement.sql create mode 100644 dmp-db-scema/updates/08/08_create_datasetexternaldataset.sql create mode 100644 dmp-db-scema/updates/08/09_Create_Invitation.sql create mode 100644 dmp-db-scema/updates/08/10_Create_User_preference.sql diff --git a/dmp-backend/web/src/main/resources/config/application-staging.properties b/dmp-backend/web/src/main/resources/config/application-staging.properties index 93e304d2f..4b92d0245 100644 --- a/dmp-backend/web/src/main/resources/config/application-staging.properties +++ b/dmp-backend/web/src/main/resources/config/application-staging.properties @@ -1,9 +1,9 @@ dmp.domain = https://devel.opendmp.eu ####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url= -database.username= -database.password= +database.url=jdbc:postgresql://dmp-db:5432/dmptool +database.username=dmptool +database.password=CHANGEME ####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## elasticsearch.host = tags-elastic-search @@ -18,10 +18,10 @@ http-logger.server-address = http://logstash:31311 pdf.converter.url=http://docsbox-web/ ####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=/tmp/ExternalUrls.xml +configuration.externalUrls=externalUrls/ExternalUrls.xml configuration.rda=/tmp/RDACommonStandards.txt -configuration.h2020template=tmp/h2020.docx -configuration.configurable_login_providers= +configuration.h2020template=documents/h2020.docx +configuration.configurable_login_providers=/tmp/ConfigurableLoginProviders.json ####################INVITATION MAIL CONFIGURATIONS############## ####################GENERIC MAIL CONFIGURATIONS################# @@ -86,4 +86,6 @@ zenodo.url=https://sandbox.zenodo.org/api/ zenodo.access_token= #############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= \ No newline at end of file +contact_email.mail= + +language.path=i18n/ \ No newline at end of file diff --git a/dmp-db-scema/updates/08/07_Remove_no_null_requirement.sql b/dmp-db-scema/updates/08/07_Remove_no_null_requirement.sql new file mode 100644 index 000000000..8cda5cf9c --- /dev/null +++ b/dmp-db-scema/updates/08/07_Remove_no_null_requirement.sql @@ -0,0 +1,2 @@ +AlTER TABLE "DMP" +ALTER COLUMN "Creator" DROP NOT NULL; \ No newline at end of file diff --git a/dmp-db-scema/updates/08/08_create_datasetexternaldataset.sql b/dmp-db-scema/updates/08/08_create_datasetexternaldataset.sql new file mode 100644 index 000000000..76e84fe22 --- /dev/null +++ b/dmp-db-scema/updates/08/08_create_datasetexternaldataset.sql @@ -0,0 +1,19 @@ +CREATE TABLE public."DatasetExternalDataset" ( + "Id" uuid DEFAULT public.uuid_generate_v4() NOT NULL, + "Dataset" uuid NOT NULL, + "ExternalDataset" uuid NOT NULL, + "Role" numeric, + "Data" character varying +); + +ALTER TABLE public."DatasetExternalDataset" OWNER TO dmptool; + +ALTER TABLE ONLY public."DatasetExternalDataset" + ADD CONSTRAINT "DatasetExternalDataset_pkey" PRIMARY KEY ("Id"); + +ALTER TABLE ONLY public."DatasetExternalDataset" + ADD CONSTRAINT fkey_datasetexternaldataset_dataset FOREIGN KEY ("Dataset") REFERENCES public."Dataset"("ID"); + +ALTER TABLE ONLY public."DatasetExternalDataset" + ADD CONSTRAINT fkey_datasetexternaldataset_externaldataset FOREIGN KEY ("ExternalDataset") REFERENCES public."ExternalDataset"("Id"); + diff --git a/dmp-db-scema/updates/08/09_Create_Invitation.sql b/dmp-db-scema/updates/08/09_Create_Invitation.sql new file mode 100644 index 000000000..c820248b1 --- /dev/null +++ b/dmp-db-scema/updates/08/09_Create_Invitation.sql @@ -0,0 +1,23 @@ +CREATE TABLE public."Invitation" ( + "Id" uuid NOT NULL, + "InvitationEmail" character varying NOT NULL, + "Token" uuid NOT NULL, + "CreationUser" uuid NOT NULL, + "Dmp" uuid NOT NULL, + "Properties" xml, + "AcceptedInvitation" boolean +); + + +ALTER TABLE public."Invitation" OWNER TO dmptool; + +ALTER TABLE ONLY public."Invitation" + ADD CONSTRAINT "Invitation_pkey" PRIMARY KEY ("Id"); + + +ALTER TABLE ONLY public."Invitation" + ADD CONSTRAINT fk_invitation_creator FOREIGN KEY ("CreationUser") REFERENCES public."UserInfo"(id); + + +ALTER TABLE ONLY public."Invitation" + ADD CONSTRAINT fk_invitation_dmp FOREIGN KEY ("Dmp") REFERENCES public."DMP"("ID"); \ No newline at end of file diff --git a/dmp-db-scema/updates/08/10_Create_User_preference.sql b/dmp-db-scema/updates/08/10_Create_User_preference.sql new file mode 100644 index 000000000..edae5bb93 --- /dev/null +++ b/dmp-db-scema/updates/08/10_Create_User_preference.sql @@ -0,0 +1,16 @@ +CREATE TABLE public."UserPreference" ( + "Id" uuid NOT NULL, + "UserId" uuid NOT NULL, + "Data" json NOT NULL, + "PreferenceType" smallint NOT NULL +); + + +ALTER TABLE public."UserPreference" OWNER TO dmptool; + +ALTER TABLE ONLY public."UserPreference" + ADD CONSTRAINT "UserPreference_pkey" PRIMARY KEY ("Id"); + + +ALTER TABLE ONLY public."UserPreference" + ADD CONSTRAINT userpreference_user_fk FOREIGN KEY ("UserId") REFERENCES public."UserInfo"(id); diff --git a/docker-compose.yml b/docker-compose.yml index f5a46f45d..18412a920 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,7 @@ services: - ./openDMP/dmp-backend/opendmp-logs:/app/logs - ./openDMP/dmp-backend/tmp:/app/tmp - ./openDMP/dmp-backend/logging:/app/logging + - ./openDMP/dmp-backend/documents:/app/documents dmp-frontend: build: