diff --git a/pattern-1/bosh-release/dbscripts/consent/mssql.sql b/pattern-1/bosh-release/dbscripts/consent/mssql.sql deleted file mode 100644 index ca72bd0..0000000 --- a/pattern-1/bosh-release/dbscripts/consent/mssql.sql +++ /dev/null @@ -1,116 +0,0 @@ -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PII_CATEGORY]') AND TYPE IN (N'U')) -CREATE TABLE CM_PII_CATEGORY ( - ID INTEGER NOT NULL IDENTITY, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - DISPLAY_NAME VARCHAR(255), - IS_SENSITIVE INTEGER NOT NULL, - TENANT_ID INTEGER DEFAULT '-1234', - CONSTRAINT CM_PII_CATEGORY_CNT UNIQUE (NAME, TENANT_ID), - PRIMARY KEY (ID) -); - -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_RECEIPT]') AND TYPE IN (N'U')) -CREATE TABLE CM_RECEIPT ( - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - VERSION VARCHAR(255) NOT NULL, - JURISDICTION VARCHAR(255) NOT NULL, - CONSENT_TIMESTAMP DATETIME NOT NULL, - COLLECTION_METHOD VARCHAR(255) NOT NULL, - LANGUAGE VARCHAR(255) NOT NULL, - PII_PRINCIPAL_ID VARCHAR(255) NOT NULL, - PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234', - POLICY_URL VARCHAR(255) NOT NULL, - STATE VARCHAR(255) NOT NULL, - PII_CONTROLLER VARCHAR(2048) NOT NULL, - PRIMARY KEY (CONSENT_RECEIPT_ID) -); - -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE]') AND TYPE IN (N'U')) -CREATE TABLE CM_PURPOSE ( - ID INTEGER NOT NULL IDENTITY, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - PURPOSE_GROUP VARCHAR(255) NOT NULL, - GROUP_TYPE VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT '-1234', - CONSTRAINT CM_PURPOSE_CNT UNIQUE (NAME, TENANT_ID, PURPOSE_GROUP, GROUP_TYPE), - PRIMARY KEY (ID) -); -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE_CATEGORY]') AND TYPE IN (N'U')) -CREATE TABLE CM_PURPOSE_CATEGORY ( - ID INTEGER NOT NULL IDENTITY, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - TENANT_ID INTEGER DEFAULT '-1234', - CONSTRAINT CM_PURPOSE_CATEGORY_CNT UNIQUE (NAME, TENANT_ID), - PRIMARY KEY (ID) -); -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_RECEIPT_SP_ASSOC]') AND TYPE IN (N'U')) -CREATE TABLE CM_RECEIPT_SP_ASSOC ( - ID INTEGER NOT NULL IDENTITY, - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - SP_NAME VARCHAR(255) NOT NULL, - SP_DISPLAY_NAME VARCHAR(255), - SP_DESCRIPTION VARCHAR(255), - SP_TENANT_ID INTEGER DEFAULT '-1234', - CONSTRAINT CM_RECEIPT_SP_ASSOC_CNT UNIQUE (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID), - FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID), - PRIMARY KEY (ID) -); - -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_ASSOC]') AND TYPE IN (N'U')) -CREATE TABLE CM_SP_PURPOSE_ASSOC ( - ID INTEGER NOT NULL IDENTITY, - RECEIPT_SP_ASSOC INTEGER NOT NULL, - PURPOSE_ID INTEGER NOT NULL, - CONSENT_TYPE VARCHAR(255) NOT NULL, - IS_PRIMARY_PURPOSE INTEGER NOT NULL, - TERMINATION VARCHAR(255) NOT NULL, - THIRD_PARTY_DISCLOSURE INTEGER NOT NULL, - THIRD_PARTY_NAME VARCHAR(255), - CONSTRAINT CM_SP_PURPOSE_ASSOC_CNT UNIQUE (RECEIPT_SP_ASSOC, PURPOSE_ID), - FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID), - FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID), - PRIMARY KEY (ID) -); - -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_PURPOSE_CAT_ASSC]') AND TYPE IN (N'U')) -CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC ( - SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, - PURPOSE_CATEGORY_ID INTEGER NOT NULL, - CONSTRAINT CM_SP_PURPOSE_PURPOSE_CAT_ASSC_CNT UNIQUE (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID), - FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID), - FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID) -); - -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE_PII_CAT_ASSOC]') AND TYPE IN (N'U')) -CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC ( - PURPOSE_ID INTEGER NOT NULL, - CM_PII_CATEGORY_ID INTEGER NOT NULL, - IS_MANDATORY INTEGER NOT NULL, - CONSTRAINT CM_PURPOSE_PII_CAT_ASSOC_CNT UNIQUE (PURPOSE_ID, CM_PII_CATEGORY_ID) -); - -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_PII_CAT_ASSOC]') AND TYPE IN (N'U')) -CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC ( - SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, - PII_CATEGORY_ID INTEGER NOT NULL, - VALIDITY VARCHAR(1023), - CONSTRAINT CM_SP_PURPOSE_PII_CAT_ASSOC_CNT UNIQUE (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID), - FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID), - FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID) -); - -IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_CONSENT_RECEIPT_PROPERTY]') AND TYPE IN (N'U')) -CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY ( - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - NAME VARCHAR(255) NOT NULL, - VALUE VARCHAR(1023) NOT NULL, - CONSTRAINT CM_CONSENT_RECEIPT_PROPERTY_CNT UNIQUE (CONSENT_RECEIPT_ID, NAME), - FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID) -); - -INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, PURPOSE_GROUP, GROUP_TYPE, TENANT_ID) VALUES ('DEFAULT', 'For core functionalities of the product', 'DEFAULT', 'SP', '-1234'); - -INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234'); diff --git a/pattern-1/bosh-release/dbscripts/consent/mysql-5.7.sql b/pattern-1/bosh-release/dbscripts/consent/mysql-5.7.sql deleted file mode 100644 index 4807b34..0000000 --- a/pattern-1/bosh-release/dbscripts/consent/mysql-5.7.sql +++ /dev/null @@ -1,124 +0,0 @@ -CREATE TABLE CM_PII_CATEGORY ( - ID INTEGER AUTO_INCREMENT, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - DISPLAY_NAME VARCHAR(255), - IS_SENSITIVE INTEGER NOT NULL, - TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (NAME, TENANT_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_RECEIPT ( - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - VERSION VARCHAR(255) NOT NULL, - JURISDICTION VARCHAR(255) NOT NULL, - CONSENT_TIMESTAMP TIMESTAMP NOT NULL, - COLLECTION_METHOD VARCHAR(255) NOT NULL, - LANGUAGE VARCHAR(255) NOT NULL, - PII_PRINCIPAL_ID VARCHAR(255) NOT NULL, - PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234', - POLICY_URL VARCHAR(255) NOT NULL, - STATE VARCHAR(255) NOT NULL, - PII_CONTROLLER VARCHAR(2048) NOT NULL, - PRIMARY KEY (CONSENT_RECEIPT_ID) -); - -CREATE TABLE CM_PURPOSE ( - ID INTEGER AUTO_INCREMENT, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - PURPOSE_GROUP VARCHAR(255) NOT NULL, - GROUP_TYPE VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (NAME, TENANT_ID, PURPOSE_GROUP, GROUP_TYPE), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_PURPOSE_CATEGORY ( - ID INTEGER AUTO_INCREMENT, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (NAME, TENANT_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_RECEIPT_SP_ASSOC ( - ID INTEGER AUTO_INCREMENT, - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - SP_NAME VARCHAR(255) NOT NULL, - SP_DISPLAY_NAME VARCHAR(255), - SP_DESCRIPTION VARCHAR(255), - SP_TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_SP_PURPOSE_ASSOC ( - ID INTEGER AUTO_INCREMENT, - RECEIPT_SP_ASSOC INTEGER NOT NULL, - PURPOSE_ID INTEGER NOT NULL, - CONSENT_TYPE VARCHAR(255) NOT NULL, - IS_PRIMARY_PURPOSE INTEGER NOT NULL, - TERMINATION VARCHAR(255) NOT NULL, - THIRD_PARTY_DISCLOSURE INTEGER NOT NULL, - THIRD_PARTY_NAME VARCHAR(255), - UNIQUE KEY (RECEIPT_SP_ASSOC, PURPOSE_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC ( - SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, - PURPOSE_CATEGORY_ID INTEGER NOT NULL, - UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID) -); - -CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC ( - PURPOSE_ID INTEGER NOT NULL, - CM_PII_CATEGORY_ID INTEGER NOT NULL, - IS_MANDATORY INTEGER NOT NULL, - UNIQUE KEY (PURPOSE_ID, CM_PII_CATEGORY_ID) -); - -CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC ( - SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, - PII_CATEGORY_ID INTEGER NOT NULL, - VALIDITY VARCHAR(1023), - UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID) -); - -CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY ( - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - NAME VARCHAR(255) NOT NULL, - VALUE VARCHAR(1023) NOT NULL, - UNIQUE KEY (CONSENT_RECEIPT_ID, NAME) -); - -ALTER TABLE CM_RECEIPT_SP_ASSOC - ADD CONSTRAINT CM_RECEIPT_SP_ASSOC_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); - -ALTER TABLE CM_SP_PURPOSE_ASSOC - ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk0 FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID); - -ALTER TABLE CM_SP_PURPOSE_ASSOC - ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk1 FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID); - -ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC - ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); - -ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC - ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk1 FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID); - -ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC - ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); - -ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC - ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk1 FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID); - -ALTER TABLE CM_CONSENT_RECEIPT_PROPERTY - ADD CONSTRAINT CM_CONSENT_RECEIPT_PRT_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); - -INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, PURPOSE_GROUP, GROUP_TYPE, TENANT_ID) VALUES ('DEFAULT', 'For core functionalities of the product', 'DEFAULT', 'SP', '-1234'); - -INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234'); diff --git a/pattern-1/bosh-release/dbscripts/consent/mysql.sql b/pattern-1/bosh-release/dbscripts/consent/mysql.sql deleted file mode 100644 index 4807b34..0000000 --- a/pattern-1/bosh-release/dbscripts/consent/mysql.sql +++ /dev/null @@ -1,124 +0,0 @@ -CREATE TABLE CM_PII_CATEGORY ( - ID INTEGER AUTO_INCREMENT, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - DISPLAY_NAME VARCHAR(255), - IS_SENSITIVE INTEGER NOT NULL, - TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (NAME, TENANT_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_RECEIPT ( - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - VERSION VARCHAR(255) NOT NULL, - JURISDICTION VARCHAR(255) NOT NULL, - CONSENT_TIMESTAMP TIMESTAMP NOT NULL, - COLLECTION_METHOD VARCHAR(255) NOT NULL, - LANGUAGE VARCHAR(255) NOT NULL, - PII_PRINCIPAL_ID VARCHAR(255) NOT NULL, - PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234', - POLICY_URL VARCHAR(255) NOT NULL, - STATE VARCHAR(255) NOT NULL, - PII_CONTROLLER VARCHAR(2048) NOT NULL, - PRIMARY KEY (CONSENT_RECEIPT_ID) -); - -CREATE TABLE CM_PURPOSE ( - ID INTEGER AUTO_INCREMENT, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - PURPOSE_GROUP VARCHAR(255) NOT NULL, - GROUP_TYPE VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (NAME, TENANT_ID, PURPOSE_GROUP, GROUP_TYPE), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_PURPOSE_CATEGORY ( - ID INTEGER AUTO_INCREMENT, - NAME VARCHAR(255) NOT NULL, - DESCRIPTION VARCHAR(1023), - TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (NAME, TENANT_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_RECEIPT_SP_ASSOC ( - ID INTEGER AUTO_INCREMENT, - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - SP_NAME VARCHAR(255) NOT NULL, - SP_DISPLAY_NAME VARCHAR(255), - SP_DESCRIPTION VARCHAR(255), - SP_TENANT_ID INTEGER DEFAULT '-1234', - UNIQUE KEY (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_SP_PURPOSE_ASSOC ( - ID INTEGER AUTO_INCREMENT, - RECEIPT_SP_ASSOC INTEGER NOT NULL, - PURPOSE_ID INTEGER NOT NULL, - CONSENT_TYPE VARCHAR(255) NOT NULL, - IS_PRIMARY_PURPOSE INTEGER NOT NULL, - TERMINATION VARCHAR(255) NOT NULL, - THIRD_PARTY_DISCLOSURE INTEGER NOT NULL, - THIRD_PARTY_NAME VARCHAR(255), - UNIQUE KEY (RECEIPT_SP_ASSOC, PURPOSE_ID), - PRIMARY KEY (ID) -); - -CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC ( - SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, - PURPOSE_CATEGORY_ID INTEGER NOT NULL, - UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID) -); - -CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC ( - PURPOSE_ID INTEGER NOT NULL, - CM_PII_CATEGORY_ID INTEGER NOT NULL, - IS_MANDATORY INTEGER NOT NULL, - UNIQUE KEY (PURPOSE_ID, CM_PII_CATEGORY_ID) -); - -CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC ( - SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, - PII_CATEGORY_ID INTEGER NOT NULL, - VALIDITY VARCHAR(1023), - UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID) -); - -CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY ( - CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, - NAME VARCHAR(255) NOT NULL, - VALUE VARCHAR(1023) NOT NULL, - UNIQUE KEY (CONSENT_RECEIPT_ID, NAME) -); - -ALTER TABLE CM_RECEIPT_SP_ASSOC - ADD CONSTRAINT CM_RECEIPT_SP_ASSOC_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); - -ALTER TABLE CM_SP_PURPOSE_ASSOC - ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk0 FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID); - -ALTER TABLE CM_SP_PURPOSE_ASSOC - ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk1 FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID); - -ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC - ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); - -ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC - ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk1 FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID); - -ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC - ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); - -ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC - ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk1 FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID); - -ALTER TABLE CM_CONSENT_RECEIPT_PROPERTY - ADD CONSTRAINT CM_CONSENT_RECEIPT_PRT_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); - -INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, PURPOSE_GROUP, GROUP_TYPE, TENANT_ID) VALUES ('DEFAULT', 'For core functionalities of the product', 'DEFAULT', 'SP', '-1234'); - -INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234'); diff --git a/pattern-1/bosh-release/dbscripts/identity/mssql.sql b/pattern-1/bosh-release/dbscripts/identity/mssql.sql index 2c1d572..fb4636e 100644 --- a/pattern-1/bosh-release/dbscripts/identity/mssql.sql +++ b/pattern-1/bosh-release/dbscripts/identity/mssql.sql @@ -955,3 +955,120 @@ CREATE TABLE IDN_OIDC_SCOPE_CLAIM_MAPPING ( ); CREATE INDEX IDX_AT_SI_ECI ON IDN_OIDC_SCOPE_CLAIM_MAPPING(SCOPE_ID, EXTERNAL_CLAIM_ID); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PII_CATEGORY]') AND TYPE IN (N'U')) +CREATE TABLE CM_PII_CATEGORY ( + ID INTEGER NOT NULL IDENTITY, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + DISPLAY_NAME VARCHAR(255), + IS_SENSITIVE INTEGER NOT NULL, + TENANT_ID INTEGER DEFAULT '-1234', + CONSTRAINT CM_PII_CATEGORY_CNT UNIQUE (NAME, TENANT_ID), + PRIMARY KEY (ID) +); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_RECEIPT]') AND TYPE IN (N'U')) +CREATE TABLE CM_RECEIPT ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + VERSION VARCHAR(255) NOT NULL, + JURISDICTION VARCHAR(255) NOT NULL, + CONSENT_TIMESTAMP DATETIME NOT NULL, + COLLECTION_METHOD VARCHAR(255) NOT NULL, + LANGUAGE VARCHAR(255) NOT NULL, + PII_PRINCIPAL_ID VARCHAR(255) NOT NULL, + PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234', + POLICY_URL VARCHAR(255) NOT NULL, + STATE VARCHAR(255) NOT NULL, + PII_CONTROLLER VARCHAR(2048) NOT NULL, + PRIMARY KEY (CONSENT_RECEIPT_ID) +); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE]') AND TYPE IN (N'U')) +CREATE TABLE CM_PURPOSE ( + ID INTEGER NOT NULL IDENTITY, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + PURPOSE_GROUP VARCHAR(255) NOT NULL, + GROUP_TYPE VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT '-1234', + CONSTRAINT CM_PURPOSE_CNT UNIQUE (NAME, TENANT_ID, PURPOSE_GROUP, GROUP_TYPE), + PRIMARY KEY (ID) +); +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE_CATEGORY]') AND TYPE IN (N'U')) +CREATE TABLE CM_PURPOSE_CATEGORY ( + ID INTEGER NOT NULL IDENTITY, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + TENANT_ID INTEGER DEFAULT '-1234', + CONSTRAINT CM_PURPOSE_CATEGORY_CNT UNIQUE (NAME, TENANT_ID), + PRIMARY KEY (ID) +); +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_RECEIPT_SP_ASSOC]') AND TYPE IN (N'U')) +CREATE TABLE CM_RECEIPT_SP_ASSOC ( + ID INTEGER NOT NULL IDENTITY, + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + SP_NAME VARCHAR(255) NOT NULL, + SP_DISPLAY_NAME VARCHAR(255), + SP_DESCRIPTION VARCHAR(255), + SP_TENANT_ID INTEGER DEFAULT '-1234', + CONSTRAINT CM_RECEIPT_SP_ASSOC_CNT UNIQUE (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID), + FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID), + PRIMARY KEY (ID) +); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_ASSOC]') AND TYPE IN (N'U')) +CREATE TABLE CM_SP_PURPOSE_ASSOC ( + ID INTEGER NOT NULL IDENTITY, + RECEIPT_SP_ASSOC INTEGER NOT NULL, + PURPOSE_ID INTEGER NOT NULL, + CONSENT_TYPE VARCHAR(255) NOT NULL, + IS_PRIMARY_PURPOSE INTEGER NOT NULL, + TERMINATION VARCHAR(255) NOT NULL, + THIRD_PARTY_DISCLOSURE INTEGER NOT NULL, + THIRD_PARTY_NAME VARCHAR(255), + CONSTRAINT CM_SP_PURPOSE_ASSOC_CNT UNIQUE (RECEIPT_SP_ASSOC, PURPOSE_ID), + FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID), + FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID), + PRIMARY KEY (ID) +); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_PURPOSE_CAT_ASSC]') AND TYPE IN (N'U')) +CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PURPOSE_CATEGORY_ID INTEGER NOT NULL, + CONSTRAINT CM_SP_PURPOSE_PURPOSE_CAT_ASSC_CNT UNIQUE (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID), + FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID), + FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID) +); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE_PII_CAT_ASSOC]') AND TYPE IN (N'U')) +CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC ( + PURPOSE_ID INTEGER NOT NULL, + CM_PII_CATEGORY_ID INTEGER NOT NULL, + IS_MANDATORY INTEGER NOT NULL, + CONSTRAINT CM_PURPOSE_PII_CAT_ASSOC_CNT UNIQUE (PURPOSE_ID, CM_PII_CATEGORY_ID) +); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_PII_CAT_ASSOC]') AND TYPE IN (N'U')) +CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PII_CATEGORY_ID INTEGER NOT NULL, + VALIDITY VARCHAR(1023), + CONSTRAINT CM_SP_PURPOSE_PII_CAT_ASSOC_CNT UNIQUE (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID), + FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID), + FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID) +); + +IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_CONSENT_RECEIPT_PROPERTY]') AND TYPE IN (N'U')) +CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + NAME VARCHAR(255) NOT NULL, + VALUE VARCHAR(1023) NOT NULL, + CONSTRAINT CM_CONSENT_RECEIPT_PROPERTY_CNT UNIQUE (CONSENT_RECEIPT_ID, NAME), + FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID) +); + +INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, PURPOSE_GROUP, GROUP_TYPE, TENANT_ID) VALUES ('DEFAULT', 'For core functionalities of the product', 'DEFAULT', 'SP', '-1234'); + +INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234'); diff --git a/pattern-1/bosh-release/dbscripts/identity/mysql-5.7.sql b/pattern-1/bosh-release/dbscripts/identity/mysql-5.7.sql index 3705fed..418214b 100644 --- a/pattern-1/bosh-release/dbscripts/identity/mysql-5.7.sql +++ b/pattern-1/bosh-release/dbscripts/identity/mysql-5.7.sql @@ -624,7 +624,7 @@ CREATE TABLE IF NOT EXISTS FIDO_DEVICE_STORE ( DEVICE_DATA VARCHAR(2048) NOT NULL, PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME, KEY_HANDLE) )ENGINE INNODB; - + CREATE TABLE IF NOT EXISTS WF_REQUEST ( UUID VARCHAR (45), CREATED_BY VARCHAR (255), @@ -878,3 +878,127 @@ CREATE TABLE IF NOT EXISTS IDN_OIDC_SCOPE_CLAIM_MAPPING ( CREATE INDEX IDX_AT_SI_ECI ON IDN_OIDC_SCOPE_CLAIM_MAPPING(SCOPE_ID, EXTERNAL_CLAIM_ID); +CREATE TABLE CM_PII_CATEGORY ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + DISPLAY_NAME VARCHAR(255), + IS_SENSITIVE INTEGER NOT NULL, + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_RECEIPT ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + VERSION VARCHAR(255) NOT NULL, + JURISDICTION VARCHAR(255) NOT NULL, + CONSENT_TIMESTAMP TIMESTAMP NOT NULL, + COLLECTION_METHOD VARCHAR(255) NOT NULL, + LANGUAGE VARCHAR(255) NOT NULL, + PII_PRINCIPAL_ID VARCHAR(255) NOT NULL, + PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234', + POLICY_URL VARCHAR(255) NOT NULL, + STATE VARCHAR(255) NOT NULL, + PII_CONTROLLER VARCHAR(2048) NOT NULL, + PRIMARY KEY (CONSENT_RECEIPT_ID) +); + +CREATE TABLE CM_PURPOSE ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + PURPOSE_GROUP VARCHAR(255) NOT NULL, + GROUP_TYPE VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID, PURPOSE_GROUP, GROUP_TYPE), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_PURPOSE_CATEGORY ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_RECEIPT_SP_ASSOC ( + ID INTEGER AUTO_INCREMENT, + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + SP_NAME VARCHAR(255) NOT NULL, + SP_DISPLAY_NAME VARCHAR(255), + SP_DESCRIPTION VARCHAR(255), + SP_TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_SP_PURPOSE_ASSOC ( + ID INTEGER AUTO_INCREMENT, + RECEIPT_SP_ASSOC INTEGER NOT NULL, + PURPOSE_ID INTEGER NOT NULL, + CONSENT_TYPE VARCHAR(255) NOT NULL, + IS_PRIMARY_PURPOSE INTEGER NOT NULL, + TERMINATION VARCHAR(255) NOT NULL, + THIRD_PARTY_DISCLOSURE INTEGER NOT NULL, + THIRD_PARTY_NAME VARCHAR(255), + UNIQUE KEY (RECEIPT_SP_ASSOC, PURPOSE_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PURPOSE_CATEGORY_ID INTEGER NOT NULL, + UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID) +); + +CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC ( + PURPOSE_ID INTEGER NOT NULL, + CM_PII_CATEGORY_ID INTEGER NOT NULL, + IS_MANDATORY INTEGER NOT NULL, + UNIQUE KEY (PURPOSE_ID, CM_PII_CATEGORY_ID) +); + +CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PII_CATEGORY_ID INTEGER NOT NULL, + VALIDITY VARCHAR(1023), + UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID) +); + +CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + NAME VARCHAR(255) NOT NULL, + VALUE VARCHAR(1023) NOT NULL, + UNIQUE KEY (CONSENT_RECEIPT_ID, NAME) +); + +ALTER TABLE CM_RECEIPT_SP_ASSOC + ADD CONSTRAINT CM_RECEIPT_SP_ASSOC_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); + +ALTER TABLE CM_SP_PURPOSE_ASSOC + ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk0 FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_ASSOC + ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk1 FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID); + +ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC + ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC + ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk1 FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID); + +ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC + ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC + ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk1 FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID); + +ALTER TABLE CM_CONSENT_RECEIPT_PROPERTY + ADD CONSTRAINT CM_CONSENT_RECEIPT_PRT_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); + +INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, PURPOSE_GROUP, GROUP_TYPE, TENANT_ID) VALUES ('DEFAULT', 'For core functionalities of the product', 'DEFAULT', 'SP', '-1234'); + +INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234'); diff --git a/pattern-1/bosh-release/dbscripts/identity/mysql.sql b/pattern-1/bosh-release/dbscripts/identity/mysql.sql index 68843e0..d779034 100644 --- a/pattern-1/bosh-release/dbscripts/identity/mysql.sql +++ b/pattern-1/bosh-release/dbscripts/identity/mysql.sql @@ -874,3 +874,127 @@ CREATE TABLE IF NOT EXISTS IDN_OIDC_SCOPE_CLAIM_MAPPING ( CREATE INDEX IDX_AT_SI_ECI ON IDN_OIDC_SCOPE_CLAIM_MAPPING(SCOPE_ID, EXTERNAL_CLAIM_ID); +CREATE TABLE CM_PII_CATEGORY ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + DISPLAY_NAME VARCHAR(255), + IS_SENSITIVE INTEGER NOT NULL, + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_RECEIPT ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + VERSION VARCHAR(255) NOT NULL, + JURISDICTION VARCHAR(255) NOT NULL, + CONSENT_TIMESTAMP TIMESTAMP NOT NULL, + COLLECTION_METHOD VARCHAR(255) NOT NULL, + LANGUAGE VARCHAR(255) NOT NULL, + PII_PRINCIPAL_ID VARCHAR(255) NOT NULL, + PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234', + POLICY_URL VARCHAR(255) NOT NULL, + STATE VARCHAR(255) NOT NULL, + PII_CONTROLLER VARCHAR(2048) NOT NULL, + PRIMARY KEY (CONSENT_RECEIPT_ID) +); + +CREATE TABLE CM_PURPOSE ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + PURPOSE_GROUP VARCHAR(255) NOT NULL, + GROUP_TYPE VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID, PURPOSE_GROUP, GROUP_TYPE), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_PURPOSE_CATEGORY ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_RECEIPT_SP_ASSOC ( + ID INTEGER AUTO_INCREMENT, + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + SP_NAME VARCHAR(255) NOT NULL, + SP_DISPLAY_NAME VARCHAR(255), + SP_DESCRIPTION VARCHAR(255), + SP_TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_SP_PURPOSE_ASSOC ( + ID INTEGER AUTO_INCREMENT, + RECEIPT_SP_ASSOC INTEGER NOT NULL, + PURPOSE_ID INTEGER NOT NULL, + CONSENT_TYPE VARCHAR(255) NOT NULL, + IS_PRIMARY_PURPOSE INTEGER NOT NULL, + TERMINATION VARCHAR(255) NOT NULL, + THIRD_PARTY_DISCLOSURE INTEGER NOT NULL, + THIRD_PARTY_NAME VARCHAR(255), + UNIQUE KEY (RECEIPT_SP_ASSOC, PURPOSE_ID), + PRIMARY KEY (ID) +); + +CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PURPOSE_CATEGORY_ID INTEGER NOT NULL, + UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID) +); + +CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC ( + PURPOSE_ID INTEGER NOT NULL, + CM_PII_CATEGORY_ID INTEGER NOT NULL, + IS_MANDATORY INTEGER NOT NULL, + UNIQUE KEY (PURPOSE_ID, CM_PII_CATEGORY_ID) +); + +CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PII_CATEGORY_ID INTEGER NOT NULL, + VALIDITY VARCHAR(1023), + UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID) +); + +CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + NAME VARCHAR(255) NOT NULL, + VALUE VARCHAR(1023) NOT NULL, + UNIQUE KEY (CONSENT_RECEIPT_ID, NAME) +); + +ALTER TABLE CM_RECEIPT_SP_ASSOC + ADD CONSTRAINT CM_RECEIPT_SP_ASSOC_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); + +ALTER TABLE CM_SP_PURPOSE_ASSOC + ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk0 FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_ASSOC + ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk1 FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID); + +ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC + ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC + ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk1 FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID); + +ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC + ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC + ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk1 FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID); + +ALTER TABLE CM_CONSENT_RECEIPT_PROPERTY + ADD CONSTRAINT CM_CONSENT_RECEIPT_PRT_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); + +INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, PURPOSE_GROUP, GROUP_TYPE, TENANT_ID) VALUES ('DEFAULT', 'For core functionalities of the product', 'DEFAULT', 'SP', '-1234'); + +INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234'); diff --git a/pattern-1/bosh-release/dbscripts/mssql.sql b/pattern-1/bosh-release/dbscripts/usermgt/mssql.sql similarity index 100% rename from pattern-1/bosh-release/dbscripts/mssql.sql rename to pattern-1/bosh-release/dbscripts/usermgt/mssql.sql diff --git a/pattern-1/bosh-release/dbscripts/mysql.sql b/pattern-1/bosh-release/dbscripts/usermgt/mysql.sql similarity index 100% rename from pattern-1/bosh-release/dbscripts/mysql.sql rename to pattern-1/bosh-release/dbscripts/usermgt/mysql.sql diff --git a/pattern-1/bosh-release/dbscripts/mysql5.7.sql b/pattern-1/bosh-release/dbscripts/usermgt/mysql5.7.sql similarity index 100% rename from pattern-1/bosh-release/dbscripts/mysql5.7.sql rename to pattern-1/bosh-release/dbscripts/usermgt/mysql5.7.sql diff --git a/pattern-1/tile/tile.yml b/pattern-1/tile/tile.yml index 346cb89..f110c45 100644 --- a/pattern-1/tile/tile.yml +++ b/pattern-1/tile/tile.yml @@ -36,30 +36,12 @@ forms: label: Database configurations description: Database configurations properties: - - name: bps_db_jdbc_url - type: string - label: BPS Datasource JDBC URL - - name: bps_db_driver - type: dropdown_select - label: BPS Datasource Driver Class Name - options: - - name: com.mysql.jdbc.Driver - label: com.mysql.jdbc.Driver - default: true - - name: com.microsoft.sqlserver.jdbc.SQLServerDriver - label: com.microsoft.sqlserver.jdbc.SQLServerDriver - - name: bps_db_query - type: string - label: BPS Datasource Validation Query - - name: bps_db_credentials - label: BPS Datasource Credentials - type: simple_credentials - name: user_db_jdbc_url type: string - label: Registry and User Management Datasource JDBC URL + label: User Management and Registry Datasource JDBC URL - name: user_db_driver type: dropdown_select - label: Registry and User Management Datasource Driver Class Name + label: User Management and Registry Datasource Driver Class Name options: - name: com.mysql.jdbc.Driver label: com.mysql.jdbc.Driver @@ -68,45 +50,45 @@ forms: label: com.microsoft.sqlserver.jdbc.SQLServerDriver - name: user_db_query type: string - label: Registry and User Management Datasource Validation Query + label: User Management and Registry Datasource Validation Query - name: user_db_credentials - label: Registry and User Management Datasource Credentials + label: User Management and Registry Datasource Credentials type: simple_credentials - - name: conf_reg_db_jdbc_url + - name: identity_db_jdbc_url type: string - label: Registry Datasource JDBC URL - - name: conf_reg_db_driver + label: Identity and Consent Management Datasource JDBC URL + - name: identity_db_driver type: dropdown_select - label: Registry Datasource Driver Class Name + label: Identity and Consent Management Datasource Driver Class Name options: - name: com.mysql.jdbc.Driver label: com.mysql.jdbc.Driver default: true - name: com.microsoft.sqlserver.jdbc.SQLServerDriver label: com.microsoft.sqlserver.jdbc.SQLServerDriver - - name: conf_reg_db_query + - name: identity_db_query type: string - label: Registry Datasource Validation Query - - name: conf_reg_db_credentials - label: Configuration Registry DB Credentials + label: Identity and Consent Management Datasource Validation Query + - name: identity_db_credentials + label: Identity and Consent Management Datasource Credentials type: simple_credentials - - name: identity_db_jdbc_url + - name: bps_db_jdbc_url type: string - label: Identity Datasource JDBC URL - - name: identity_db_driver + label: Business Process Datasource JDBC URL + - name: bps_db_driver type: dropdown_select - label: Identity Datasource Driver Class Name + label: Business Process Datasource Driver Class Name options: - name: com.mysql.jdbc.Driver label: com.mysql.jdbc.Driver default: true - name: com.microsoft.sqlserver.jdbc.SQLServerDriver label: com.microsoft.sqlserver.jdbc.SQLServerDriver - - name: identity_db_query + - name: bps_db_query type: string - label: Identity Datasource Validation Query - - name: identity_db_credentials - label: Identity Datasource Credentials + label: Business Process Datasource Validation Query + - name: bps_db_credentials + label: Business Process Datasource Credentials type: simple_credentials - name: Consent Management Configurations @@ -169,15 +151,6 @@ forms: type: ca_certificate configurable: true -- name: License key - label: License key - description: License key - properties: - - name: license_key - label: License key for WSO2 subscription - type: text - configurable: true - - name: Admin credentials label: Admin credentials description: Admin credentials @@ -243,8 +216,6 @@ packages: admin: username: (( .properties.admin_credentials.identity )) password: (( .properties.admin_credentials.password )) - license_key: - value: (( .properties.license_key.value )) certs: value: (( .properties.ca_cert.value )) bps_ds: @@ -260,11 +231,11 @@ packages: username: (( .properties.user_db_credentials.identity )) password: (( .properties.user_db_credentials.password )) conf_reg_db: - jdbc_url: (( .properties.conf_reg_db_jdbc_url.value )) - driver: (( .properties.conf_reg_db_driver.value )) - query: (( .properties.conf_reg_db_query.value )) - username: (( .properties.conf_reg_db_credentials.identity )) - password: (( .properties.conf_reg_db_credentials.password )) + jdbc_url: (( .properties.user_db_jdbc_url.value )) + driver: (( .properties.user_db_driver.value )) + query: (( .properties.user_db_query.value )) + username: (( .properties.user_db_credentials.identity )) + password: (( .properties.user_db_credentials.password )) identity_db: jdbc_url: (( .properties.identity_db_jdbc_url.value )) driver: (( .properties.identity_db_driver.value ))