Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 5fa81987 authored by Pawel GUTOWSKI's avatar Pawel GUTOWSKI
Browse files

EDELIVERY-1871 EDELIVERY-1893 Updated Oracle schema - changes dedicated for multitenancy

parent 55612da4
No related branches found
No related tags found
No related merge requests found
-- Copyright 2018 European Commission | CEF eDelivery
--
-- Copyright 2017 European Commission | CEF eDelivery
--
-- Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
-- Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
-- You may not use this work except in compliance with the Licence.
--
-- You may obtain a copy of the Licence at:
-- https://joinup.ec.europa.eu/software/page/eupl
-- or file: LICENCE-EUPL-v1.1.pdf
-- You may obtain a copy of the Licence attached in file: LICENCE-EUPL-v1.2.pdf
--
-- Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......
--
-- Copyright 2017 European Commission | CEF eDelivery
-- Copyright 2018 European Commission | CEF eDelivery
--
-- Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
-- Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
-- You may not use this work except in compliance with the Licence.
--
-- You may obtain a copy of the Licence at:
-- https://joinup.ec.europa.eu/software/page/eupl
-- or file: LICENCE-EUPL-v1.1.pdf
-- You may obtain a copy of the Licence attached in file: LICENCE-EUPL-v1.2.pdf
--
-- Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the Licence for the specific language governing permissions and limitations under the Licence.
CREATE TABLE smp_domain (
domainId VARCHAR(50),
bdmslClientCertHeader VARCHAR(4000),
bdmslClientCertAlias VARCHAR(50),
signatureCertAlias VARCHAR(50),
PRIMARY KEY(domainId),
CONSTRAINT check_max_one_auth CHECK (
NOT (bdmslClientCertAlias IS NOT NULL AND bdmslClientCertHeader IS NOT NULL)
)
);
CREATE TABLE smp_service_group (
extension CLOB,
businessIdentifier VARCHAR(50) NOT NULL,
businessIdentifierScheme VARCHAR(100) NOT NULL,
PRIMARY KEY (businessIdentifier, businessIdentifierScheme)
domainId VARCHAR(50) DEFAULT 'default' NOT NULL,
PRIMARY KEY (businessIdentifier, businessIdentifierScheme),
CONSTRAINT
FK_srv_group_domain FOREIGN KEY (domainId)
REFERENCES smp_domain (domainId)
);
CREATE TABLE smp_service_metadata (
......@@ -55,3 +67,10 @@ CREATE TABLE smp_ownership (
businessIdentifier, businessIdentifierScheme)
REFERENCES smp_service_group (businessIdentifier, businessIdentifierScheme)
);
INSERT INTO smp_domain(domainId) VALUES('default');
--default admin user with password "changeit"
INSERT INTO smp_user(username, password, isadmin) VALUES ('smp_admin', '$2a$10$SZXMo7K/wA.ULWxH7uximOxeNk4mf3zU6nxJx/2VfKA19QlqwSpNO', '1');
commit;
\ No newline at end of file
-- Copyright 2018 European Commission | CEF eDelivery
--
-- Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
-- You may not use this work except in compliance with the Licence.
--
-- You may obtain a copy of the Licence attached in file: LICENCE-EUPL-v1.2.pdf
--
-- Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the Licence for the specific language governing permissions and limitations under the Licence.
CREATE TABLE smp_domain (
domainId VARCHAR(50),
bdmslClientCertHeader VARCHAR(4000),
bdmslClientCertAlias VARCHAR(50),
signatureCertAlias VARCHAR(50),
PRIMARY KEY(domainId),
CONSTRAINT check_max_one_auth CHECK (
NOT (bdmslClientCertAlias IS NOT NULL AND bdmslClientCertHeader IS NOT NULL)
)
);
INSERT INTO smp_domain(domainId) VALUES('default');
ALTER TABLE smp_service_group ADD (
domainId VARCHAR(50) DEFAULT 'default' NOT NULL
);
ALTER TABLE smp_service_group ADD (
CONSTRAINT
FK_srv_group_domain FOREIGN KEY (domainId)
REFERENCES smp_domain (domainId)
);
commit;
\ No newline at end of file
......@@ -18,7 +18,7 @@ package eu.europa.ec.edelivery.smp.data.model;
*/
public class CommonColumnsLengths {
public static final int MAX_IDENTIFIER_SCHEME_LENGTH = 100;
public static final int MAX_PARTICIPANT_IDENTIFIER_VALUE_LENGTH = 50;
public static final int MAX_IDENTIFIER_VALUE_LENGTH = 50;
public static final int MAX_DOCUMENT_TYPE_IDENTIFIER_VALUE_LENGTH = 500;
public static final int MAX_USERNAME_LENGTH = 256;
}
......@@ -48,7 +48,7 @@ public class DBOwnershipId implements Serializable {
return participantIdScheme;
}
@Column(name = "businessIdentifier", nullable = false, length = CommonColumnsLengths.MAX_PARTICIPANT_IDENTIFIER_VALUE_LENGTH)
@Column(name = "businessIdentifier", nullable = false, length = CommonColumnsLengths.MAX_IDENTIFIER_VALUE_LENGTH)
public String getBusinessIdentifier() {
return participantIdValue;
}
......
......@@ -21,7 +21,7 @@ import javax.persistence.Embeddable;
import java.io.Serializable;
import static eu.europa.ec.edelivery.smp.data.model.CommonColumnsLengths.MAX_IDENTIFIER_SCHEME_LENGTH;
import static eu.europa.ec.edelivery.smp.data.model.CommonColumnsLengths.MAX_PARTICIPANT_IDENTIFIER_VALUE_LENGTH;
import static eu.europa.ec.edelivery.smp.data.model.CommonColumnsLengths.MAX_IDENTIFIER_VALUE_LENGTH;
@Embeddable
@ToString
......@@ -46,7 +46,7 @@ public class DBServiceGroupId implements Serializable {
return participantIdScheme;
}
@Column(name = "businessIdentifier", nullable = false, length = MAX_PARTICIPANT_IDENTIFIER_VALUE_LENGTH)
@Column(name = "businessIdentifier", nullable = false, length = MAX_IDENTIFIER_VALUE_LENGTH)
public String getBusinessIdentifier() {
return participantIdValue;
}
......
......@@ -50,7 +50,7 @@ public class DBServiceMetadataId implements Serializable {
return participantIdScheme;
}
@Column(name = "businessIdentifier", nullable = false, length = MAX_PARTICIPANT_IDENTIFIER_VALUE_LENGTH)
@Column(name = "businessIdentifier", nullable = false, length = MAX_IDENTIFIER_VALUE_LENGTH)
public String getBusinessIdentifier() {
return participantIdValue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment