diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai-schema-db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai-schema-db2.sql index 5880e0239f..fb1589a82f 100644 --- a/common/kadai-common/src/main/resources/sql/db2/kadai-schema-db2.sql +++ b/common/kadai-common/src/main/resources/sql/db2/kadai-schema-db2.sql @@ -10,12 +10,12 @@ CREATE TABLE KADAI_SCHEMA_VERSION CREATE SEQUENCE KADAI_SCHEMA_VERSION_ID_SEQ MINVALUE 1 - START WITH 100 + START WITH 1000 INCREMENT BY 1 CACHE 10; -- The VERSION value must be equal or higher then the value of KadaiEngineImpl.MINIMAL_KADAI_SCHEMA_VERSION INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.1.0', CURRENT_TIMESTAMP); +VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '9.0.0', CURRENT_TIMESTAMP); CREATE TABLE CLASSIFICATION ( diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_0.9.2_to_1.0.2_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_0.9.2_to_1.0.2_db2.sql deleted file mode 100644 index b305da4b52..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_0.9.2_to_1.0.2_db2.sql +++ /dev/null @@ -1,56 +0,0 @@ --- this script migrates the schema only. --- data is not migrated, as this is currently not necessary. - -SET SCHEMA %schemaName%; - -DROP TABLE KADAI_SCHEMA_VERSION; - -CREATE TABLE KADAI_SCHEMA_VERSION( - ID INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), - VERSION VARCHAR(255) NOT NULL, - CREATED TIMESTAMP NOT NULL, - PRIMARY KEY (ID) -); -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('0.9.2', CURRENT_TIMESTAMP); -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.0.2', CURRENT_TIMESTAMP); - -DROP TABLE JOB; - -CREATE TABLE SCHEDULED_JOB( - JOB_ID INTEGER NOT NULL, - PRIORITY INTEGER NULL, - CREATED TIMESTAMP NULL, - DUE TIMESTAMP NULL, - STATE VARCHAR(32) NULL, - LOCKED_BY VARCHAR(32) NULL, - LOCK_EXPIRES TIMESTAMP NULL, - TYPE VARCHAR(32) NULL, - RETRY_COUNT INTEGER NOT NULL, - ARGUMENTS CLOB NULL, - PRIMARY KEY (JOB_ID) -); - -DROP SEQUENCE JOB_SEQ; - -CREATE SEQUENCE SCHEDULED_JOB_SEQ - MINVALUE 1 - START WITH 1 - INCREMENT BY 1 - CACHE 10; - -ALTER TABLE CLASSIFICATION - ADD COLUMN PARENT_KEY - VARCHAR(32) NOT NULL DEFAULT ''; - -UPDATE CLASSIFICATION C - SET C.PARENT_KEY = - (SELECT KEY FROM CLASSIFICATION WHERE ID = C.PARENT_ID) - WHERE C.PARENT_ID != ''; - -ALTER TABLE TASK - ADD COLUMN CALLBACK_INFO - CLOB NULL DEFAULT NULL; - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN ACCESS_NAME - VARCHAR(255) NULL DEFAULT NULL; diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_1.0.4_to_1.0.6_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_1.0.4_to_1.0.6_db2.sql deleted file mode 100644 index ef3d415028..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_1.0.4_to_1.0.6_db2.sql +++ /dev/null @@ -1,11 +0,0 @@ --- this script update the tables KADAI_SCHEMA_VERSION and TASK. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.0.6', CURRENT_TIMESTAMP); - -ALTER TABLE TASK ADD COLUMN EXTERNAL_ID VARCHAR(64) NOT NULL DEFAULT ''; - -UPDATE TASK T1 SET(EXTERNAL_ID) = ('ETI:' CONCAT (SELECT RIGHT(ID, (LENGTH(ID) - 4) ) FROM TASK T2 WHERE T1.ID = T2.ID)); - -ALTER TABLE TASK ADD CONSTRAINT UC_EXTERNAL_ID UNIQUE (EXTERNAL_ID); diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_2.0.2_to_3.0.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_2.0.2_to_3.0.0_db2.sql deleted file mode 100644 index 2a434784cd..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_2.0.2_to_3.0.0_db2.sql +++ /dev/null @@ -1,66 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and HISTORY_EVENTS. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('3.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE HISTORY_EVENTS DROP COLUMN COMMENT, DROP COLUMN OLD_DATA, DROP COLUMN NEW_DATA, ADD COLUMN DETAILS CLOB; - -ALTER TABLE CLASSIFICATION ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE CLASSIFICATION allow read access' ); - -ALTER TABLE WORKBASKET ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE WORKBASKET allow read access' ); - -ALTER TABLE TASK ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE TASK allow read access' ); - -ALTER TABLE TASK ALTER COLUMN WORKBASKET_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE TASK allow read access' ); - -ALTER TABLE TASK ALTER COLUMN CLASSIFICATION_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE TASK allow read access' ); - -ALTER TABLE DISTRIBUTION_TARGETS ALTER COLUMN SOURCE_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE DISTRIBUTION_TARGETS allow read access' ); - -ALTER TABLE DISTRIBUTION_TARGETS ALTER COLUMN TARGET_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE DISTRIBUTION_TARGETS allow read access' ); - -ALTER TABLE WORKBASKET_ACCESS_LIST ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE WORKBASKET_ACCESS_LIST allow read access' ); - -ALTER TABLE WORKBASKET_ACCESS_LIST ALTER COLUMN WORKBASKET_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE WORKBASKET_ACCESS_LIST allow read access' ); - -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE OBJECT_REFERENCE allow read access' ); - -ALTER TABLE ATTACHMENT ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE ATTACHMENT allow read access' ); - -ALTER TABLE ATTACHMENT ALTER COLUMN TASK_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE ATTACHMENT allow read access' ); - -ALTER TABLE ATTACHMENT ALTER COLUMN CLASSIFICATION_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE ATTACHMENT allow read access' ); - -ALTER TABLE TASK_COMMENT ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE TASK_COMMENT allow read access' ); - -ALTER TABLE TASK_COMMENT ALTER COLUMN TASK_ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE TASK_COMMENT allow read access' ); - -CREATE TABLE CONFIGURATION ( - ENFORCE_SECURITY BOOLEAN NOT NULL -); - --- TSK-1227 allow null values in OBJECT_REFERENCE#SYSTEM and OBJECT_REFERENCE#SYSTEM_INSTANCE - -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN SYSTEM DROP NOT NULL; -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN SYSTEM_INSTANCE DROP NOT NULL; -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE OBJECT_REFERENCE allow read access' ); - -ALTER TABLE TASK ALTER COLUMN POR_SYSTEM DROP NOT NULL; -ALTER TABLE TASK ALTER COLUMN POR_INSTANCE DROP NOT NULL; -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE TASK allow read access' ); diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_3.0.0_to_4.0.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_3.0.0_to_4.0.0_db2.sql deleted file mode 100644 index f09e2a1377..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_3.0.0_to_4.0.0_db2.sql +++ /dev/null @@ -1,72 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and HISTORY_EVENTS. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE HISTORY_EVENTS ALTER COLUMN ID DROP IDENTITY; - -ALTER TABLE HISTORY_EVENTS DROP PRIMARY KEY; - -ALTER TABLE HISTORY_EVENTS ALTER COLUMN ID SET DATA TYPE VARCHAR(40); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE HISTORY_EVENTS allow read access' ); - -ALTER TABLE HISTORY_EVENTS ADD PRIMARY KEY (ID); -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE HISTORY_EVENTS allow read access' ); - -RENAME TABLE HISTORY_EVENTS TO TASK_HISTORY_EVENT; - -UPDATE TASK_HISTORY_EVENT SET ID = REPLACE(ID,'HEI','THI') WHERE ID LIKE '%HEI%'; - -CREATE TABLE WORKBASKET_HISTORY_EVENT -( - ID VARCHAR(40) NOT NULL, - EVENT_TYPE VARCHAR(40) NULL, - CREATED TIMESTAMP NULL, - USER_ID VARCHAR(32) NULL, - DOMAIN VARCHAR(32) NULL, - WORKBASKET_ID VARCHAR(40) NULL, - KEY VARCHAR(64) NULL, - TYPE VARCHAR(64) NULL, - OWNER VARCHAR(128) NULL, - CUSTOM_1 VARCHAR(255) NULL, - CUSTOM_2 VARCHAR(255) NULL, - CUSTOM_3 VARCHAR(255) NULL, - CUSTOM_4 VARCHAR(255) NULL, - ORGLEVEL_1 VARCHAR(255) NULL, - ORGLEVEL_2 VARCHAR(255) NULL, - ORGLEVEL_3 VARCHAR(255) NULL, - ORGLEVEL_4 VARCHAR(255) NULL, - DETAILS CLOB NULL, - PRIMARY KEY (ID) -); - -CREATE TABLE CLASSIFICATION_HISTORY_EVENT -( - ID VARCHAR(40) NOT NULL, - EVENT_TYPE VARCHAR(40) NULL, - CREATED TIMESTAMP NULL, - USER_ID VARCHAR(32) NULL, - CLASSIFICATION_ID VARCHAR(40) NULL, - APPLICATION_ENTRY_POINT VARCHAR(255) NULL, - CATEGORY VARCHAR(64) NULL, - DOMAIN VARCHAR(32) NULL, - KEY VARCHAR(40) NULL, - NAME VARCHAR(255) NULL, - PARENT_ID VARCHAR(40) NOT NULL, - PARENT_KEY VARCHAR(32) NOT NULL, - PRIORITY INT NOT NULL, - SERVICE_LEVEL VARCHAR(255) NULL, - TYPE VARCHAR(32), - CUSTOM_1 VARCHAR(255) NULL, - CUSTOM_2 VARCHAR(255) NULL, - CUSTOM_3 VARCHAR(255) NULL, - CUSTOM_4 VARCHAR(255) NULL, - CUSTOM_5 VARCHAR(255) NULL, - CUSTOM_6 VARCHAR(255) NULL, - CUSTOM_7 VARCHAR(255) NULL, - CUSTOM_8 VARCHAR(255) NULL, - DETAILS CLOB NULL, - PRIMARY KEY (ID) -); - diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.0.0_to_4.3.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.0.0_to_4.3.0_db2.sql deleted file mode 100644 index b8ec679afb..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.0.0_to_4.3.0_db2.sql +++ /dev/null @@ -1,9 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and ATTACHMENT. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP); - -ALTER TABLE ATTACHMENT ALTER COLUMN REF_SYSTEM DROP NOT NULL ALTER COLUMN REF_INSTANCE DROP NOT NULL; - -CALL SYSPROC.ADMIN_CMD ('REORG TABLE ATTACHMENT'); diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.11.0_to_5.0.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.11.0_to_5.0.0_db2.sql deleted file mode 100644 index 5d871edb70..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.11.0_to_5.0.0_db2.sql +++ /dev/null @@ -1,97 +0,0 @@ --- this script updates the KADAI database schema from version 4.11.0 to version 5.0.0. --- REORGS are only necessary for _some_ altering operations. See https://www.ibm.com/docs/en/db2/11.1?topic=statements-alter-table -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE OBJECT_REFERENCE ADD COLUMN TASK_ID VARCHAR(40) NOT NULL DEFAULT 'EMPTY'; - -DROP INDEX "DB2ADMIN"."IDX1805212017540"; -DROP INDEX "DB2ADMIN"."IDX1805212018000"; -DROP INDEX "DB2ADMIN"."IDX1805212018030"; -DROP INDEX "DB2ADMIN"."IDX1805212020000"; -DROP INDEX "DB2ADMIN"."IDX1805212021410"; -DROP INDEX "DB2ADMIN"."IDX1805212021430"; -DROP INDEX "DB2ADMIN"."IDX1805212024540"; -DROP INDEX "DB2ADMIN"."IDX1805212025210"; -DROP INDEX "DB2ADMIN"."IDX1805212028580"; -DROP INDEX "DB2ADMIN"."IDX1805212034070"; -DROP INDEX "DB2ADMIN"."IDX1805212039070"; -DROP INDEX "DB2ADMIN"."IDX1805212040470"; -DROP INDEX "DB2ADMIN"."IDX1805212042430"; - - -CREATE UNIQUE INDEX IDX_CLASSIFICATION_ID ON CLASSIFICATION - ("ID" ASC) - INCLUDE ("CUSTOM_8", "CUSTOM_7", "CUSTOM_6", "CUSTOM_5", "CUSTOM_4", "CUSTOM_3", "CUSTOM_2", - "CUSTOM_1", "APPLICATION_ENTRY_POINT", "SERVICE_LEVEL", "PRIORITY", "DESCRIPTION", "NAME", - "CREATED", "VALID_IN_DOMAIN", "DOMAIN", "TYPE", "CATEGORY", "PARENT_KEY", "PARENT_ID", "KEY") - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE INDEX IDX_CLASSIFICATION_CATEGORY ON CLASSIFICATION - ("CATEGORY" ASC, "DOMAIN" ASC, "TYPE" ASC, "CUSTOM_1" ASC, "CUSTOM_8" ASC, "CUSTOM_7" ASC, - "CUSTOM_6" ASC, "CUSTOM_5" ASC, "CUSTOM_4" ASC, "CUSTOM_3" ASC, "CUSTOM_2" ASC, - "APPLICATION_ENTRY_POINT" ASC, "SERVICE_LEVEL" ASC, "PRIORITY" ASC, "DESCRIPTION" ASC, - "NAME" ASC, "CREATED" ASC, "VALID_IN_DOMAIN" ASC, "PARENT_KEY" ASC, "PARENT_ID" ASC, "KEY" ASC, - "ID" ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE UNIQUE INDEX IDX_CLASSIFICATION_KEY_DOMAIN ON CLASSIFICATION - ("KEY" ASC, "DOMAIN" ASC) - INCLUDE ("CUSTOM_8", "CUSTOM_7", "CUSTOM_6", "CUSTOM_5", "CUSTOM_4", "CUSTOM_3", "CUSTOM_2", - "CUSTOM_1", "APPLICATION_ENTRY_POINT", "SERVICE_LEVEL", "PRIORITY", "DESCRIPTION", "NAME", - "CREATED", "VALID_IN_DOMAIN", "TYPE", "CATEGORY", "PARENT_KEY", "PARENT_ID", "ID") - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE INDEX IDX_TASK_WORKBASKET_KEY_DOMAIN ON TASK - ("WORKBASKET_KEY" ASC, "DOMAIN" DESC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE INDEX IDX_TASK_POR_VALUE ON TASK - (LOWER("POR_VALUE") ASC, "WORKBASKET_ID" ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE INDEX IDX_ATTACHMENT_TASK_ID ON ATTACHMENT - ("TASK_ID" ASC, "RECEIVED" ASC, "CLASSIFICATION_ID" ASC, "CLASSIFICATION_KEY" ASC, - "MODIFIED" ASC, "CREATED" ASC, "ID" ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE UNIQUE INDEX IDX_WORKBASKET_ID ON WORKBASKET - ("ID" ASC) - INCLUDE ("ORG_LEVEL_4", "ORG_LEVEL_3", "ORG_LEVEL_2", "ORG_LEVEL_1", "OWNER", "DESCRIPTION", - "TYPE", "DOMAIN", "NAME", "KEY") - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE UNIQUE INDEX IDX_WORKBASKET_KEY_DOMAIN ON WORKBASKET - ("KEY" ASC, "DOMAIN" ASC) - INCLUDE ("ORG_LEVEL_4", "ORG_LEVEL_3", "ORG_LEVEL_2", "ORG_LEVEL_1", "CUSTOM_4", "CUSTOM_3", - "CUSTOM_2", "CUSTOM_1", "OWNER", "DESCRIPTION", "TYPE", "NAME", "MODIFIED", "CREATED", "ID") - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE UNIQUE INDEX IDX_WORKBASKET_KEY_DOMAIN_ID ON WORKBASKET - ("KEY" ASC, "DOMAIN" ASC) - INCLUDE ("ID") - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE INDEX IDX_WORKBASKET_ACCESS_LIST_ACCESS_ID ON WORKBASKET_ACCESS_LIST - ("ACCESS_ID" ASC, "WORKBASKET_ID" ASC, "PERM_READ" ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE INDEX IDX_WORKBASKET_ACCESS_LIST_WORKBASKET_ID ON WORKBASKET_ACCESS_LIST - ("WORKBASKET_ID" ASC, "PERM_CUSTOM_12" ASC, "PERM_CUSTOM_11" ASC, "PERM_CUSTOM_10" ASC, - "PERM_CUSTOM_9" ASC, "PERM_CUSTOM_8" ASC, "PERM_CUSTOM_7" ASC, "PERM_CUSTOM_6" ASC, - "PERM_CUSTOM_5" ASC, "PERM_CUSTOM_4" ASC, "PERM_CUSTOM_3" ASC, "PERM_CUSTOM_2" ASC, - "PERM_CUSTOM_1" ASC, "PERM_DISTRIBUTE" ASC, "PERM_TRANSFER" ASC, "PERM_APPEND" ASC, - "PERM_OPEN" ASC, "PERM_READ" ASC, "ACCESS_ID" ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; - COMMIT WORK ; diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.3.0_to_4.8.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.3.0_to_4.8.0_db2.sql deleted file mode 100644 index 68b6a52753..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.3.0_to_4.8.0_db2.sql +++ /dev/null @@ -1,49 +0,0 @@ --- this script updates the KADAI database schema from version 4.3.0 to version 4.8.0. --- REORGS are only necessary for _some_ altering operations. See https://www.ibm.com/docs/en/db2/11.1?topic=statements-alter-table -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.8.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK ADD COLUMN RECEIVED TIMESTAMP NULL; -ALTER TABLE TASK ADD COLUMN MANUAL_PRIORITY INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_1 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_2 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_3 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_4 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_5 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_6 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_7 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_8 INT NULL; - -ALTER TABLE CONFIGURATION ADD COLUMN CUSTOM_ATTRIBUTES CLOB NULL; - -ALTER TABLE SCHEDULED_JOB ALTER COLUMN TYPE SET DATA TYPE VARCHAR(255); - -ALTER TABLE CLASSIFICATION ALTER COLUMN DOMAIN SET DATA TYPE VARCHAR(32); --- reorg necessary since column has an index defined -CALL SYSPROC.ADMIN_CMD ('REORG TABLE CLASSIFICATION'); - -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_PRIORITY INT NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_PLANNED TIMESTAMP NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_DUE TIMESTAMP NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_OWNER VARCHAR(32) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_CLASSIFICATION_NAME VARCHAR(255) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN ATTACHMENT_CLASSIFICATION_NAME VARCHAR(255) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN WORKBASKET_NAME VARCHAR(255) NULL; - -CREATE TABLE USER_INFO ( - USER_ID VARCHAR(32) NOT NULL, - FIRST_NAME VARCHAR(32) NULL, - LASTNAME VARCHAR(32) NULL, - FULL_NAME VARCHAR(64) NULL, - LONG_NAME VARCHAR(64) NULL, - E_MAIL VARCHAR(64) NULL, - PHONE VARCHAR(32) NULL, - MOBILE_PHONE VARCHAR(32) NULL, - ORG_LEVEL_4 VARCHAR(32) NULL, - ORG_LEVEL_3 VARCHAR(32) NULL, - ORG_LEVEL_2 VARCHAR(32) NULL, - ORG_LEVEL_1 VARCHAR(32) NULL, - DATA CLOB NULL, - PRIMARY KEY (USER_ID) -); diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.8.0_to_4.11.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.8.0_to_4.11.0_db2.sql deleted file mode 100644 index 811b55ca5c..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_4.8.0_to_4.11.0_db2.sql +++ /dev/null @@ -1,46 +0,0 @@ --- this script updates the KADAI database schema from version 4.8.0 to version 4.11.0. --- REORGS are only necessary for _some_ altering operations. See https://www.ibm.com/docs/en/db2/11.1?topic=statements-alter-table -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.11.0', CURRENT_TIMESTAMP); - -ALTER TABLE CONFIGURATION ADD COLUMN NAME VARCHAR(8) NOT NULL DEFAULT 'MASTER'; -ALTER TABLE CONFIGURATION ALTER COLUMN ENFORCE_SECURITY DROP NOT NULL; -ALTER TABLE CONFIGURATION ALTER COLUMN NAME DROP DEFAULT; -CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE CONFIGURATION allow read access' ); -ALTER TABLE CONFIGURATION ADD PRIMARY KEY (NAME); - -insert into CONFIGURATION (NAME) (select 'MASTER' from sysibm.sysdummy1 -where not exists (select * from CONFIGURATION where NAME = 'MASTER')); - -UPDATE TASK SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE TASK SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE TASK SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE TASK SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; -UPDATE TASK SET CUSTOM_5 = '' WHERE CUSTOM_5 IS NULL; -UPDATE TASK SET CUSTOM_6 = '' WHERE CUSTOM_6 IS NULL; -UPDATE TASK SET CUSTOM_7 = '' WHERE CUSTOM_7 IS NULL; -UPDATE TASK SET CUSTOM_8 = '' WHERE CUSTOM_8 IS NULL; -UPDATE TASK SET CUSTOM_9 = '' WHERE CUSTOM_9 IS NULL; -UPDATE TASK SET CUSTOM_10 = '' WHERE CUSTOM_10 IS NULL; -UPDATE TASK SET CUSTOM_11 = '' WHERE CUSTOM_11 IS NULL; -UPDATE TASK SET CUSTOM_12 = '' WHERE CUSTOM_12 IS NULL; -UPDATE TASK SET CUSTOM_13 = '' WHERE CUSTOM_13 IS NULL; -UPDATE TASK SET CUSTOM_14 = '' WHERE CUSTOM_14 IS NULL; -UPDATE TASK SET CUSTOM_15 = '' WHERE CUSTOM_15 IS NULL; -UPDATE TASK SET CUSTOM_16 = '' WHERE CUSTOM_16 IS NULL; - -UPDATE WORKBASKET SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE WORKBASKET SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE WORKBASKET SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE WORKBASKET SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; - -UPDATE CLASSIFICATION SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_5 = '' WHERE CUSTOM_5 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_6 = '' WHERE CUSTOM_6 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_7 = '' WHERE CUSTOM_7 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_8 = '' WHERE CUSTOM_8 IS NULL; - diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.0.0_to_5.1.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.0.0_to_5.1.0_db2.sql deleted file mode 100644 index d7fdb43f1f..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.0.0_to_5.1.0_db2.sql +++ /dev/null @@ -1,17 +0,0 @@ --- this script updates the KADAI database schema from version 5.0.0 to version 5.1.0. --- REORGS are only necessary for _some_ altering operations. See https://www.ibm.com/docs/en/db2/11.1?topic=statements-alter-table -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.1.0', CURRENT_TIMESTAMP); - -DROP INDEX IDX_TASK_POR_VALUE; - -CREATE INDEX IDX_TASK_POR_VALUE ON TASK - ("POR_VALUE" ASC, "WORKBASKET_ID" ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; - -CREATE INDEX IDX_TASK_LOWER_POR_VALUE ON TASK - (LOWER("POR_VALUE") ASC, "WORKBASKET_ID" ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.1.0_to_5.2.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.1.0_to_5.2.0_db2.sql deleted file mode 100644 index faa42fdb45..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.1.0_to_5.2.0_db2.sql +++ /dev/null @@ -1,12 +0,0 @@ --- this script updates the KADAI database schema from version 5.1.0 to version 5.2.0. - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.2.0', CURRENT_TIMESTAMP); - -CREATE TABLE GROUP_INFO -( - USER_ID VARCHAR(32) NOT NULL, - GROUP_ID VARCHAR(256) NOT NULL, - PRIMARY KEY (USER_ID, GROUP_ID) -); - -ALTER TABLE SCHEDULED_JOB ALTER COLUMN LOCKED_BY SET DATA TYPE VARCHAR(128); diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.10.0_to_6.2.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.10.0_to_6.2.0_db2.sql deleted file mode 100644 index 05d9385b1a..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.10.0_to_6.2.0_db2.sql +++ /dev/null @@ -1,19 +0,0 @@ --- this script updates the KADAI database schema from version 5.10.0 to version 6.2.0. -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '6.2.0', CURRENT_TIMESTAMP); - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN PERM_READTASKS SMALLINT NOT NULL DEFAULT 0; -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_READTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER COLUMN PERM_READTASKS DROP DEFAULT; - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL DEFAULT 0; -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_EDITTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER COLUMN PERM_EDITTASKS DROP DEFAULT; diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.2.0_to_5.10.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.2.0_to_5.10.0_db2.sql deleted file mode 100644 index a70e5cc2ef..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_5.2.0_to_5.10.0_db2.sql +++ /dev/null @@ -1,24 +0,0 @@ --- this script updates the KADAI database schema from version 5.2.0 to version 5.10.0. -SET SCHEMA %schemaName%; - -ALTER TABLE KADAI_SCHEMA_VERSION ALTER COLUMN ID DROP IDENTITY; - -CREATE SEQUENCE KADAI_SCHEMA_VERSION_ID_SEQ - MINVALUE 1 - START WITH 100 - INCREMENT BY 1 CACHE 10; - --- The VERSION value must be equal or higher then the value of KadaiEngineImpl.MINIMAL_KADAI_SCHEMA_VERSION -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '5.10.0', CURRENT_TIMESTAMP); - -CREATE INDEX IDX_OBJECT_REFERE_PK_ID ON OBJECT_REFERENCE - (ID ASC) ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; -CREATE INDEX IDX_OBJECT_REFERE_FK_TASK_ID ON OBJECT_REFERENCE - (TASK_ID ASC) ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; -CREATE INDEX IDX_OBJECT_REFERE_ACCESS_LIST ON OBJECT_REFERENCE - (VALUE ASC, TYPE ASC, SYSTEM_INSTANCE ASC, SYSTEM ASC, COMPANY ASC, ID ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_6.2.0_to_7.0.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_6.2.0_to_7.0.0_db2.sql deleted file mode 100644 index 18d47357a6..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_6.2.0_to_7.0.0_db2.sql +++ /dev/null @@ -1,23 +0,0 @@ --- this script updates the KADAI database schema from version 6.2.0 to version 7.0.0. -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.0.0', CURRENT_TIMESTAMP); - -CREATE TABLE PERMISSION_INFO -( - USER_ID VARCHAR(32) NOT NULL, - PERMISSION_ID VARCHAR(256) NOT NULL, - PRIMARY KEY (USER_ID, PERMISSION_ID) -); - -ALTER TABLE WORKBASKET - ADD COLUMN CUSTOM_5 VARCHAR(255) NULL - ADD COLUMN CUSTOM_6 VARCHAR(255) NULL - ADD COLUMN CUSTOM_7 VARCHAR(255) NULL - ADD COLUMN CUSTOM_8 VARCHAR(255) NULL; - -CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT - (TASK_ID ASC) - ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS; -COMMIT WORK ; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_7.0.0_to_7.1.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_7.0.0_to_7.1.0_db2.sql deleted file mode 100644 index b3e54dbcca..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_7.0.0_to_7.1.0_db2.sql +++ /dev/null @@ -1,19 +0,0 @@ --- this script updates the KADAI database schema from version 7.0.0. to version 7.1.0. -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT -FROM ( - SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT - FROM TASK t - RIGHT OUTER JOIN TASK_COMMENT tc - ON t.ID = tc.TASK_ID - GROUP BY t.ID -) AS subquery -WHERE t.ID = subquery.ID; diff --git a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_8.1.0_to_8.2.0_db2.sql b/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_8.1.0_to_8.2.0_db2.sql deleted file mode 100644 index 5234bc4028..0000000000 --- a/common/kadai-common/src/main/resources/sql/db2/kadai_schema_update_8.1.0_to_8.2.0_db2.sql +++ /dev/null @@ -1,19 +0,0 @@ --- this script updates the KADAI database schema from version 8.1.0. to version 8.2.0. -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT -FROM ( - SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT - FROM TASK t - RIGHT OUTER JOIN TASK_COMMENT tc - ON t.ID = tc.TASK_ID - GROUP BY t.ID -) AS subquery -WHERE t.ID = subquery.ID; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/db2/taskana_8.2.0_to_kadai_9.0.0_schema_update_db2.sql b/common/kadai-common/src/main/resources/sql/db2/taskana_8.2.0_to_kadai_9.0.0_schema_update_db2.sql new file mode 100644 index 0000000000..ea6d74baf5 --- /dev/null +++ b/common/kadai-common/src/main/resources/sql/db2/taskana_8.2.0_to_kadai_9.0.0_schema_update_db2.sql @@ -0,0 +1,13 @@ +-- this script updates the database schema from TASKANA version 8.2.0 to KADAI version 9.0.0. +SET SCHEMA %schemaName%; + +RENAME TABLE TASKANA_SCHEMA_VERSION TO KADAI_SCHEMA_VERSION; + +DROP SEQUENCE TASKANA_SCHEMA_VERSION_ID_SEQ; +CREATE SEQUENCE KADAI_SCHEMA_VERSION_ID_SEQ + MINVALUE 1 + START WITH 1000 + INCREMENT BY 1 CACHE 10; + +INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) +VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '9.0.0', CURRENT_TIMESTAMP); diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai-schema-h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai-schema-h2.sql index 7c2d3c608b..6316b7a26b 100644 --- a/common/kadai-common/src/main/resources/sql/h2/kadai-schema-h2.sql +++ b/common/kadai-common/src/main/resources/sql/h2/kadai-schema-h2.sql @@ -22,7 +22,7 @@ CREATE SEQUENCE KADAI_SCHEMA_VERSION_ID_SEQ -- The VERSION value must be equal or higher then the value of KadaiEngineImpl.MINIMAL_KADAI_SCHEMA_VERSION INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); +VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '9.0.0', CURRENT_TIMESTAMP); CREATE TABLE CLASSIFICATION ( diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_0.9.2_to_1.0.2_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_0.9.2_to_1.0.2_h2.sql deleted file mode 100644 index b305da4b52..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_0.9.2_to_1.0.2_h2.sql +++ /dev/null @@ -1,56 +0,0 @@ --- this script migrates the schema only. --- data is not migrated, as this is currently not necessary. - -SET SCHEMA %schemaName%; - -DROP TABLE KADAI_SCHEMA_VERSION; - -CREATE TABLE KADAI_SCHEMA_VERSION( - ID INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), - VERSION VARCHAR(255) NOT NULL, - CREATED TIMESTAMP NOT NULL, - PRIMARY KEY (ID) -); -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('0.9.2', CURRENT_TIMESTAMP); -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.0.2', CURRENT_TIMESTAMP); - -DROP TABLE JOB; - -CREATE TABLE SCHEDULED_JOB( - JOB_ID INTEGER NOT NULL, - PRIORITY INTEGER NULL, - CREATED TIMESTAMP NULL, - DUE TIMESTAMP NULL, - STATE VARCHAR(32) NULL, - LOCKED_BY VARCHAR(32) NULL, - LOCK_EXPIRES TIMESTAMP NULL, - TYPE VARCHAR(32) NULL, - RETRY_COUNT INTEGER NOT NULL, - ARGUMENTS CLOB NULL, - PRIMARY KEY (JOB_ID) -); - -DROP SEQUENCE JOB_SEQ; - -CREATE SEQUENCE SCHEDULED_JOB_SEQ - MINVALUE 1 - START WITH 1 - INCREMENT BY 1 - CACHE 10; - -ALTER TABLE CLASSIFICATION - ADD COLUMN PARENT_KEY - VARCHAR(32) NOT NULL DEFAULT ''; - -UPDATE CLASSIFICATION C - SET C.PARENT_KEY = - (SELECT KEY FROM CLASSIFICATION WHERE ID = C.PARENT_ID) - WHERE C.PARENT_ID != ''; - -ALTER TABLE TASK - ADD COLUMN CALLBACK_INFO - CLOB NULL DEFAULT NULL; - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN ACCESS_NAME - VARCHAR(255) NULL DEFAULT NULL; diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.2_to_1.0.4_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.2_to_1.0.4_h2.sql deleted file mode 100644 index e78eb622fe..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.2_to_1.0.4_h2.sql +++ /dev/null @@ -1,7 +0,0 @@ --- this script update the tables KADAI_SCHEMA_VERSION and WORKBASKET. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.0.4', CURRENT_TIMESTAMP); - -ALTER TABLE WORKBASKET ADD COLUMN MARKED_FOR_DELETION SMALLINT NOT NULL DEFAULT false; diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.4_to_1.0.6_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.4_to_1.0.6_h2.sql deleted file mode 100644 index ac16333d97..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.4_to_1.0.6_h2.sql +++ /dev/null @@ -1,11 +0,0 @@ --- this script update the tables KADAI_SCHEMA_VERSION and TASK. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.0.6', CURRENT_TIMESTAMP); - -ALTER TABLE TASK ADD COLUMN EXTERNAL_ID VARCHAR(64) NOT NULL DEFAULT ''; - -UPDATE TASK T1 SET(EXTERNAL_ID) = (CONCAT('ETI:', (SELECT RIGHT(ID, (LENGTH(ID) - 4)) FROM TASK T2 WHERE T1.ID = T2.ID))); - -ALTER TABLE TASK ADD CONSTRAINT UC_EXTERNAL_ID UNIQUE (EXTERNAL_ID); diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.6_to_1.1.5_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.6_to_1.1.5_h2.sql deleted file mode 100644 index 444862cbb1..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.0.6_to_1.1.5_h2.sql +++ /dev/null @@ -1,9 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and TASK. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.1.5', CURRENT_TIMESTAMP); - -ALTER TABLE TASK ADD COLUMN CALLBACK_STATE VARCHAR(30) NULL DEFAULT 'NONE'; -UPDATE TASK T SET CALLBACK_STATE = 'NONE'; - diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.1.5_to_1.2.1_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.1.5_to_1.2.1_h2.sql deleted file mode 100644 index 61d4364b8f..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.1.5_to_1.2.1_h2.sql +++ /dev/null @@ -1,12 +0,0 @@ --- this script adds a unique constraint to WORKBASKET_ACCESS_LIST --- allowing a maximum of one WORKBASKET_ACCESS_LIST per workbasket and access_id --- Please replace %schemaName% before executing the script - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.2.1', CURRENT_TIMESTAMP); - --- If the database contains records that violate this constraint, the following statement will fail. --- In this case it is required to remove the conflicting records before the constraint can be added - -ALTER TABLE WORKBASKET_ACCESS_LIST ADD CONSTRAINT UC_ACCESSID_WBID UNIQUE (ACCESS_ID, WORKBASKET_ID); diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.2.1_to_2.0.2_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.2.1_to_2.0.2_h2.sql deleted file mode 100644 index 3f89062307..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_1.2.1_to_2.0.2_h2.sql +++ /dev/null @@ -1,16 +0,0 @@ --- this script adds a TASK_COMMENT table and updates the table KADAI_SCHEMA_VERSION. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('2.0.2', CURRENT_TIMESTAMP); - -CREATE TABLE TASK_COMMENT( - ID CHAR(40) NOT NULL, - TASK_ID CHAR(40) NOT NULL, - TEXT_FIELD VARCHAR(1024) NULL, - CREATOR VARCHAR(32) NULL, - CREATED TIMESTAMP NULL, - MODIFIED TIMESTAMP NULL, - PRIMARY KEY (ID), - CONSTRAINT COMMENT_TASK FOREIGN KEY (TASK_ID) REFERENCES TASK ON DELETE CASCADE -); \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_2.0.2_to_3.0.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_2.0.2_to_3.0.0_h2.sql deleted file mode 100644 index c492083dfa..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_2.0.2_to_3.0.0_h2.sql +++ /dev/null @@ -1,50 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and HISTORY_EVENTS. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('3.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE HISTORY_EVENTS DROP COLUMN COMMENT, DROP COLUMN OLD_DATA, DROP COLUMN NEW_DATA, ADD COLUMN DETAILS CLOB; - -ALTER TABLE CLASSIFICATION ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE WORKBASKET ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE TASK ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE TASK ALTER COLUMN WORKBASKET_ID VARCHAR(40); - -ALTER TABLE TASK ALTER COLUMN CLASSIFICATION_ID VARCHAR(40); - -ALTER TABLE DISTRIBUTION_TARGETS ALTER COLUMN SOURCE_ID VARCHAR(40); - -ALTER TABLE DISTRIBUTION_TARGETS ALTER COLUMN TARGET_ID VARCHAR(40); - -ALTER TABLE WORKBASKET_ACCESS_LIST ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE WORKBASKET_ACCESS_LIST ALTER COLUMN WORKBASKET_ID VARCHAR(40); - -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE ATTACHMENT ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE ATTACHMENT ALTER COLUMN TASK_ID VARCHAR(40); - -ALTER TABLE ATTACHMENT ALTER COLUMN CLASSIFICATION_ID VARCHAR(40); - -ALTER TABLE TASK_COMMENT ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE TASK_COMMENT ALTER COLUMN TASK_ID VARCHAR(40); - -CREATE TABLE CONFIGURATION ( - ENFORCE_SECURITY BOOLEAN NOT NULL -); - --- TSK-1227 allow null values in OBJECT_REFERENCE#SYSTEM and OBJECT_REFERENCE#SYSTEM_INSTANCE - -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN SYSTEM SET NULL; -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN SYSTEM_INSTANCE SET NULL; - -ALTER TABLE TASK ALTER COLUMN POR_SYSTEM SET NULL; -ALTER TABLE TASK ALTER COLUMN POR_INSTANCE SET NULL; - diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_3.0.0_to_4.0.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_3.0.0_to_4.0.0_h2.sql deleted file mode 100644 index 1cf9da1821..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_3.0.0_to_4.0.0_h2.sql +++ /dev/null @@ -1,65 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and HISTORY_EVENTS. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE HISTORY_EVENTS ALTER COLUMN ID VARCHAR(40); - -ALTER TABLE HISTORY_EVENTS RENAME TO TASK_HISTORY_EVENT; - -UPDATE TASK_HISTORY_EVENT SET ID = REPLACE(ID,'HEI','THI') WHERE ID LIKE '%HEI%'; - -CREATE TABLE WORKBASKET_HISTORY_EVENT -( - ID VARCHAR(40) NOT NULL, - EVENT_TYPE VARCHAR(40) NULL, - CREATED TIMESTAMP NULL, - USER_ID VARCHAR(32) NULL, - DOMAIN VARCHAR(32) NULL, - WORKBASKET_ID VARCHAR(40) NULL, - KEY VARCHAR(64) NULL, - TYPE VARCHAR(64) NULL, - OWNER VARCHAR(128) NULL, - CUSTOM_1 VARCHAR(255) NULL, - CUSTOM_2 VARCHAR(255) NULL, - CUSTOM_3 VARCHAR(255) NULL, - CUSTOM_4 VARCHAR(255) NULL, - ORGLEVEL_1 VARCHAR(255) NULL, - ORGLEVEL_2 VARCHAR(255) NULL, - ORGLEVEL_3 VARCHAR(255) NULL, - ORGLEVEL_4 VARCHAR(255) NULL, - DETAILS CLOB NULL, - PRIMARY KEY (ID) -); - -CREATE TABLE CLASSIFICATION_HISTORY_EVENT -( - ID VARCHAR(40) NOT NULL, - EVENT_TYPE VARCHAR(40) NULL, - CREATED TIMESTAMP NULL, - USER_ID VARCHAR(32) NULL, - CLASSIFICATION_ID VARCHAR(40) NULL, - APPLICATION_ENTRY_POINT VARCHAR(255) NULL, - CATEGORY VARCHAR(64) NULL, - DOMAIN VARCHAR(32) NULL, - KEY VARCHAR(40) NULL, - NAME VARCHAR(255) NULL, - PARENT_ID VARCHAR(40) NOT NULL, - PARENT_KEY VARCHAR(32) NOT NULL, - PRIORITY INT NOT NULL, - SERVICE_LEVEL VARCHAR(255) NULL, - TYPE VARCHAR(32), - CUSTOM_1 VARCHAR(255) NULL, - CUSTOM_2 VARCHAR(255) NULL, - CUSTOM_3 VARCHAR(255) NULL, - CUSTOM_4 VARCHAR(255) NULL, - CUSTOM_5 VARCHAR(255) NULL, - CUSTOM_6 VARCHAR(255) NULL, - CUSTOM_7 VARCHAR(255) NULL, - CUSTOM_8 VARCHAR(255) NULL, - DETAILS CLOB NULL, - PRIMARY KEY (ID) -); - - diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.0.0_to_4.3.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.0.0_to_4.3.0_h2.sql deleted file mode 100644 index f331327cb3..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.0.0_to_4.3.0_h2.sql +++ /dev/null @@ -1,6 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and ATTACHMENT. -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP); - -ALTER TABLE ATTACHMENT ALTER COLUMN REF_SYSTEM DROP NOT NULL; - -ALTER TABLE ATTACHMENT ALTER COLUMN REF_INSTANCE DROP NOT NULL; diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.11.0_to_5.0.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.11.0_to_5.0.0_h2.sql deleted file mode 100644 index d17468107d..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.11.0_to_5.0.0_h2.sql +++ /dev/null @@ -1,5 +0,0 @@ --- this script updates the KADAI database schema from version 4.11.0 to version 5.0.0. - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE OBJECT_REFERENCE ADD COLUMN TASK_ID VARCHAR(40) NOT NULL DEFAULT 'EMPTY'; diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.3.0_to_4.8.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.3.0_to_4.8.0_h2.sql deleted file mode 100644 index 6fe063e7b5..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.3.0_to_4.8.0_h2.sql +++ /dev/null @@ -1,45 +0,0 @@ --- this script updates the KADAI database schema from version 4.3.0 to version 4.8.0. - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.8.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK ADD COLUMN RECEIVED TIMESTAMP NULL; -ALTER TABLE TASK ADD COLUMN MANUAL_PRIORITY INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_1 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_2 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_3 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_4 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_5 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_6 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_7 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_8 INT NULL; - -ALTER TABLE CONFIGURATION ADD COLUMN CUSTOM_ATTRIBUTES CLOB NULL; - -ALTER TABLE SCHEDULED_JOB ALTER COLUMN TYPE SET DATA TYPE VARCHAR(255); - -ALTER TABLE CLASSIFICATION ALTER COLUMN DOMAIN SET DATA TYPE VARCHAR(32); - -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_PRIORITY INT NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_PLANNED TIMESTAMP NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_DUE TIMESTAMP NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_OWNER VARCHAR(32) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_CLASSIFICATION_NAME VARCHAR(255) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN ATTACHMENT_CLASSIFICATION_NAME VARCHAR(255) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN WORKBASKET_NAME VARCHAR(255) NULL; - -CREATE TABLE USER_INFO ( - USER_ID VARCHAR(32) NOT NULL, - FIRST_NAME VARCHAR(32) NULL, - LASTNAME VARCHAR(32) NULL, - FULL_NAME VARCHAR(64) NULL, - LONG_NAME VARCHAR(64) NULL, - E_MAIL VARCHAR(64) NULL, - PHONE VARCHAR(32) NULL, - MOBILE_PHONE VARCHAR(32) NULL, - ORG_LEVEL_4 VARCHAR(32) NULL, - ORG_LEVEL_3 VARCHAR(32) NULL, - ORG_LEVEL_2 VARCHAR(32) NULL, - ORG_LEVEL_1 VARCHAR(32) NULL, - DATA CLOB NULL, - PRIMARY KEY (USER_ID) -); diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.8.0_to_4.11.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.8.0_to_4.11.0_h2.sql deleted file mode 100644 index a18d4d9bbd..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_4.8.0_to_4.11.0_h2.sql +++ /dev/null @@ -1,41 +0,0 @@ --- this script updates the KADAI database schema from version 4.8.0 to version 4.11.0. - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.11.0', CURRENT_TIMESTAMP); - -ALTER TABLE CONFIGURATION ADD COLUMN NAME VARCHAR(8) NOT NULL DEFAULT 'MASTER'; -ALTER TABLE CONFIGURATION ALTER COLUMN ENFORCE_SECURITY DROP NOT NULL; -ALTER TABLE CONFIGURATION ALTER COLUMN NAME DROP DEFAULT; -ALTER TABLE CONFIGURATION ADD PRIMARY KEY (NAME); - -INSERT INTO CONFIGURATION (NAME) VALUES ('MASTER'); - -UPDATE TASK SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE TASK SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE TASK SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE TASK SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; -UPDATE TASK SET CUSTOM_5 = '' WHERE CUSTOM_5 IS NULL; -UPDATE TASK SET CUSTOM_6 = '' WHERE CUSTOM_6 IS NULL; -UPDATE TASK SET CUSTOM_7 = '' WHERE CUSTOM_7 IS NULL; -UPDATE TASK SET CUSTOM_8 = '' WHERE CUSTOM_8 IS NULL; -UPDATE TASK SET CUSTOM_9 = '' WHERE CUSTOM_9 IS NULL; -UPDATE TASK SET CUSTOM_10 = '' WHERE CUSTOM_10 IS NULL; -UPDATE TASK SET CUSTOM_11 = '' WHERE CUSTOM_11 IS NULL; -UPDATE TASK SET CUSTOM_12 = '' WHERE CUSTOM_12 IS NULL; -UPDATE TASK SET CUSTOM_13 = '' WHERE CUSTOM_13 IS NULL; -UPDATE TASK SET CUSTOM_14 = '' WHERE CUSTOM_14 IS NULL; -UPDATE TASK SET CUSTOM_15 = '' WHERE CUSTOM_15 IS NULL; -UPDATE TASK SET CUSTOM_16 = '' WHERE CUSTOM_16 IS NULL; - -UPDATE WORKBASKET SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE WORKBASKET SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE WORKBASKET SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE WORKBASKET SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; - -UPDATE CLASSIFICATION SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_5 = '' WHERE CUSTOM_5 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_6 = '' WHERE CUSTOM_6 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_7 = '' WHERE CUSTOM_7 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_8 = '' WHERE CUSTOM_8 IS NULL; diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.0.0_to_5.1.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.0.0_to_5.1.0_h2.sql deleted file mode 100644 index 16a4b48534..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.0.0_to_5.1.0_h2.sql +++ /dev/null @@ -1,3 +0,0 @@ --- this script updates the KADAI database schema from version 5.0.0 to version 5.1.0. - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.1.0', CURRENT_TIMESTAMP); diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.1.0_to_5.2.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.1.0_to_5.2.0_h2.sql deleted file mode 100644 index faa42fdb45..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.1.0_to_5.2.0_h2.sql +++ /dev/null @@ -1,12 +0,0 @@ --- this script updates the KADAI database schema from version 5.1.0 to version 5.2.0. - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.2.0', CURRENT_TIMESTAMP); - -CREATE TABLE GROUP_INFO -( - USER_ID VARCHAR(32) NOT NULL, - GROUP_ID VARCHAR(256) NOT NULL, - PRIMARY KEY (USER_ID, GROUP_ID) -); - -ALTER TABLE SCHEDULED_JOB ALTER COLUMN LOCKED_BY SET DATA TYPE VARCHAR(128); diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.10.0_to_6.2.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.10.0_to_6.2.0_h2.sql deleted file mode 100644 index be7fca524d..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.10.0_to_6.2.0_h2.sql +++ /dev/null @@ -1,19 +0,0 @@ --- this script updates the KADAI database schema from version 5.10.0 to version 6.2.0. -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '6.2.0', CURRENT_TIMESTAMP); - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN PERM_READTASKS SMALLINT NOT NULL DEFAULT 0; -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_READTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER COLUMN PERM_READTASKS DROP DEFAULT; - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL DEFAULT 0; -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_EDITTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER COLUMN PERM_EDITTASKS DROP DEFAULT; diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.2.0_to_5.10.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.2.0_to_5.10.0_h2.sql deleted file mode 100644 index 43a7b64ba7..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_5.2.0_to_5.10.0_h2.sql +++ /dev/null @@ -1,24 +0,0 @@ --- this script updates the KADAI database schema from version 5.2.0 to version 5.10.0. - -SET SCHEMA %schemaName%; - -ALTER TABLE KADAI_SCHEMA_VERSION ALTER COLUMN ID DROP IDENTITY; - -CREATE SEQUENCE KADAI_SCHEMA_VERSION_ID_SEQ - MINVALUE 1 - START WITH 100 - INCREMENT BY 1 CACHE 10; - --- The VERSION value must be equal or higher then the value of KadaiEngineImpl.MINIMAL_KADAI_SCHEMA_VERSION -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '5.10.0', CURRENT_TIMESTAMP); - -CREATE INDEX IDX_OBJECT_REFERE_PK_ID ON OBJECT_REFERENCE - (ID ASC); -COMMIT WORK ; -CREATE INDEX IDX_OBJECT_REFERE_FK_TASK_ID ON OBJECT_REFERENCE - (TASK_ID ASC); -COMMIT WORK ; -CREATE INDEX IDX_OBJECT_REFERE_ACCESS_LIST ON OBJECT_REFERENCE - (VALUE ASC, TYPE ASC, SYSTEM_INSTANCE ASC, SYSTEM ASC, COMPANY ASC, ID ASC); -COMMIT WORK ; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_6.2.0_to_7.0.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_6.2.0_to_7.0.0_h2.sql deleted file mode 100644 index 7032b965d4..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_6.2.0_to_7.0.0_h2.sql +++ /dev/null @@ -1,19 +0,0 @@ --- this script updates the KADAI database schema from version 6.2.0 to version 7.0.0. - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP); - -CREATE TABLE PERMISSION_INFO -( - USER_ID VARCHAR(32) NOT NULL, - PERMISSION_ID VARCHAR(256) NOT NULL, - PRIMARY KEY (USER_ID, PERMISSION_ID) -); - -ALTER TABLE WORKBASKET - ADD ( - `CUSTOM_5` VARCHAR(255) NULL, - `CUSTOM_6` VARCHAR(255) NULL, - `CUSTOM_7` VARCHAR(255) NULL, - `CUSTOM_8` VARCHAR(255) NULL - ) AFTER `MARKED_FOR_DELETION`; diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_7.0.0_to_7.1.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_7.0.0_to_7.1.0_h2.sql deleted file mode 100644 index e0068dd914..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_7.0.0_to_7.1.0_h2.sql +++ /dev/null @@ -1,20 +0,0 @@ --- this script updates the KADAI database schema from version 7.0.0 to version 7.1.0. -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = ( - SELECT COUNT(tc.ID) - FROM TASK_COMMENT tc - WHERE tc.TASK_ID = t.ID -) -WHERE EXISTS ( - SELECT 1 - FROM TASK_COMMENT tc - WHERE tc.TASK_ID = t.ID -); diff --git a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_8.1.0_to_8.2.0_h2.sql b/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_8.1.0_to_8.2.0_h2.sql deleted file mode 100644 index c72edb38f0..0000000000 --- a/common/kadai-common/src/main/resources/sql/h2/kadai_schema_update_8.1.0_to_8.2.0_h2.sql +++ /dev/null @@ -1,20 +0,0 @@ --- this script updates the KADAI database schema from version 8.1.0 to version 8.2.0. -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = ( - SELECT COUNT(tc.ID) - FROM TASK_COMMENT tc - WHERE tc.TASK_ID = t.ID -) -WHERE EXISTS ( - SELECT 1 - FROM TASK_COMMENT tc - WHERE tc.TASK_ID = t.ID -); \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_5.10.0_to_6.2.0_oracle.sql b/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_5.10.0_to_6.2.0_oracle.sql deleted file mode 100644 index 4b97771501..0000000000 --- a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_5.10.0_to_6.2.0_oracle.sql +++ /dev/null @@ -1,20 +0,0 @@ --- this script updates the KADAI database schema from version 5.10.0 to version 6.2.0. -ALTER -SESSION SET CURRENT_SCHEMA = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (KADAI_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '6.2.0', CURRENT_TIMESTAMP); - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD PERM_READTASKS NUMBER(1) DEFAULT 0 NOT NULL CHECK (PERM_READTASKS IN (0,1)); -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_READTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER PERM_READTASKS DROP DEFAULT; - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD PERM_EDITTASKS NUMBER(1) DEFAULT 0 NOT NULL CHECK (PERM_EDITTASKS IN (0,1)); -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_EDITTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER PERM_EDITTASKS DROP DEFAULT diff --git a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_6.2.0_to_7.0.0_oracle.sql b/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_6.2.0_to_7.0.0_oracle.sql deleted file mode 100644 index bbda31e5f2..0000000000 --- a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_6.2.0_to_7.0.0_oracle.sql +++ /dev/null @@ -1,24 +0,0 @@ --- this script updates the KADAI database schema from version 6.2.0 to version 7.0.0. -ALTER SESSION SET CURRENT_SCHEMA = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP); - -CREATE TABLE PERMISSION_INFO -( - USER_ID VARCHAR2(32) NOT NULL, - PERMISSION_ID VARCHAR2(256) NOT NULL, - CONSTRAINT PERMISSION_INFO_PKEY PRIMARY KEY (USER_ID, PERMISSION_ID) -); - -ALTER TABLE WORKBASKET -ADD ( - CUSTOM_5 VARCHAR(255) NULL, - CUSTOM_6 VARCHAR(255) NULL, - CUSTOM_7 VARCHAR(255) NULL, - CUSTOM_8 VARCHAR(255) NULL -); - -CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT - (TASK_ID ASC); -COMMIT WORK ; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_7.0.0_to_7.1.0_oracle.sql b/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_7.0.0_to_7.1.0_oracle.sql deleted file mode 100644 index 4db7ecaf62..0000000000 --- a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_7.0.0_to_7.1.0_oracle.sql +++ /dev/null @@ -1,19 +0,0 @@ --- this script updates the KADAI database schema from version 7.0.0 to version 7.1.0. -ALTER SESSION SET CURRENT_SCHEMA = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT -FROM ( - SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT - FROM TASK t - RIGHT OUTER JOIN TASK_COMMENT tc - ON t.ID = tc.TASK_ID - GROUP BY t.ID -) AS subquery -WHERE t.ID = subquery.ID; diff --git a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_8.1.0_to_8.2.0_oracle.sql b/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_8.1.0_to_8.2.0_oracle.sql deleted file mode 100644 index 25075f10db..0000000000 --- a/common/kadai-common/src/main/resources/sql/oracle/kadai_schema_update_8.1.0_to_8.2.0_oracle.sql +++ /dev/null @@ -1,19 +0,0 @@ --- this script updates the KADAI database schema from version 8.1.0 to version 8.2.0. -ALTER SESSION SET CURRENT_SCHEMA = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT -FROM ( - SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT - FROM TASK t - RIGHT OUTER JOIN TASK_COMMENT tc - ON t.ID = tc.TASK_ID - GROUP BY t.ID -) AS subquery -WHERE t.ID = subquery.ID; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai-schema-postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai-schema-postgres.sql index fc97c88b16..965b9fed0e 100644 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai-schema-postgres.sql +++ b/common/kadai-common/src/main/resources/sql/postgres/kadai-schema-postgres.sql @@ -13,12 +13,12 @@ CREATE TABLE KADAI_SCHEMA_VERSION CREATE SEQUENCE KADAI_SCHEMA_VERSION_ID_SEQ MINVALUE 1 - START WITH 100 + START WITH 1000 INCREMENT BY 1 CACHE 10; -- The VERSION value must be equal or higher then the value of KadaiEngineImpl.MINIMAL_KADAI_SCHEMA_VERSION INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); +VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '9.0.0', CURRENT_TIMESTAMP); CREATE TABLE CLASSIFICATION ( diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_0.9.2_to_1.0.2_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_0.9.2_to_1.0.2_postgres.sql deleted file mode 100644 index 5b136b05e7..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_0.9.2_to_1.0.2_postgres.sql +++ /dev/null @@ -1,56 +0,0 @@ --- this script migrates the schema only. --- data is not migrated, as this is currently not necessary. - -SET SCHEMA %schemaName%; - -DROP TABLE KADAI_SCHEMA_VERSION; - -CREATE TABLE KADAI_SCHEMA_VERSION( - ID INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), - VERSION VARCHAR(255) NOT NULL, - CREATED TIMESTAMP NOT NULL, - PRIMARY KEY (ID) -); -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('0.9.2', CURRENT_TIMESTAMP); -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.0.2', CURRENT_TIMESTAMP); - -DROP TABLE JOB; - -CREATE TABLE SCHEDULED_JOB( - JOB_ID INTEGER NOT NULL, - PRIORITY INTEGER NULL, - CREATED TIMESTAMP NULL, - DUE TIMESTAMP NULL, - STATE VARCHAR(32) NULL, - LOCKED_BY VARCHAR(32) NULL, - LOCK_EXPIRES TIMESTAMP NULL, - TYPE VARCHAR(32) NULL, - RETRY_COUNT INTEGER NOT NULL, - ARGUMENTS TEXT NULL, - PRIMARY KEY (JOB_ID) -); - -DROP SEQUENCE JOB_SEQ; - -CREATE SEQUENCE SCHEDULED_JOB_SEQ - MINVALUE 1 - START WITH 1 - INCREMENT BY 1 - CACHE 10; - -ALTER TABLE CLASSIFICATION - ADD COLUMN PARENT_KEY - VARCHAR(32) NOT NULL DEFAULT ''; - -UPDATE CLASSIFICATION C - SET C.PARENT_KEY = - (SELECT KEY FROM CLASSIFICATION WHERE ID = C.PARENT_ID) - WHERE C.PARENT_ID != ''; - -ALTER TABLE TASK - ADD COLUMN CALLBACK_INFO - TEXT NULL DEFAULT NULL; - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN ACCESS_NAME - VARCHAR(255) NULL DEFAULT NULL; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.0.2_to_1.0.4_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.0.2_to_1.0.4_postgres.sql deleted file mode 100644 index 9a951e1060..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.0.2_to_1.0.4_postgres.sql +++ /dev/null @@ -1,7 +0,0 @@ --- this script update the tables KADAI_SCHEMA_VERSION and WORKBASKET in postgre database. - -SET SCHEMA %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.0.4', CURRENT_TIMESTAMP); - -ALTER TABLE WORKBASKET ADD COLUMN MARKED_FOR_DELETION BOOLEAN NOT NULL DEFAULT false; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.0.6_to_1.1.5._postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.0.6_to_1.1.5._postgres.sql deleted file mode 100644 index 9d694a250a..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.0.6_to_1.1.5._postgres.sql +++ /dev/null @@ -1,9 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and TASK. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.1.5', CURRENT_TIMESTAMP); - -ALTER TABLE TASK ADD COLUMN CALLBACK_STATE VARCHAR(30) NULL DEFAULT 'NONE'; -UPDATE TASK T SET CALLBACK_STATE = 'NONE'; - diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.1.5_to_1.2.1_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.1.5_to_1.2.1_postgres.sql deleted file mode 100644 index 8969a50bc6..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.1.5_to_1.2.1_postgres.sql +++ /dev/null @@ -1,12 +0,0 @@ --- this script adds a unique constraint to WORKBASKET_ACCESS_LIST --- allowing a maximum of one WORKBASKET_ACCESS_LIST per workbasket and access_id --- Please replace %schemaName% before executing the script - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('1.2.1', CURRENT_TIMESTAMP); - --- If the database contains records that violate this constraint, the following statement will fail. --- In this case it is required to remove the conflicting records before the constraint can be added - -ALTER TABLE WORKBASKET_ACCESS_LIST ADD CONSTRAINT UC_ACCESSID_WBID UNIQUE (ACCESS_ID, WORKBASKET_ID); diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.2.1_to_2.0.2_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.2.1_to_2.0.2_postgres.sql deleted file mode 100644 index 342acc56b7..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_1.2.1_to_2.0.2_postgres.sql +++ /dev/null @@ -1,16 +0,0 @@ --- this script adds a TASK_COMMENT table and updates the table KADAI_SCHEMA_VERSION. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('2.0.2', CURRENT_TIMESTAMP); - -CREATE TABLE TASK_COMMENT( - ID CHAR(40) NOT NULL, - TASK_ID CHAR(40) NOT NULL, - TEXT_FIELD VARCHAR(1024) NULL, - CREATOR VARCHAR(32) NULL, - CREATED TIMESTAMP NULL, - MODIFIED TIMESTAMP NULL, - PRIMARY KEY (ID), - CONSTRAINT COMMENT_TASK FOREIGN KEY (TASK_ID) REFERENCES TASK ON DELETE CASCADE -); \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_2.0.2_to_3.0.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_2.0.2_to_3.0.0_postgres.sql deleted file mode 100644 index 8d8c74472b..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_2.0.2_to_3.0.0_postgres.sql +++ /dev/null @@ -1,51 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and HISTORY_EVENTS. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('3.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE HISTORY_EVENTS DROP COLUMN COMMENT, DROP COLUMN OLD_DATA, DROP COLUMN NEW_DATA, ADD COLUMN DETAILS TEXT; - -ALTER TABLE CLASSIFICATION ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE WORKBASKET ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE TASK ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE TASK ALTER COLUMN WORKBASKET_ID TYPE VARCHAR(40); - -ALTER TABLE TASK ALTER COLUMN CLASSIFICATION_ID TYPE VARCHAR(40); - -ALTER TABLE DISTRIBUTION_TARGETS ALTER COLUMN SOURCE_ID TYPE VARCHAR(40); - -ALTER TABLE DISTRIBUTION_TARGETS ALTER COLUMN TARGET_ID TYPE VARCHAR(40); - -ALTER TABLE WORKBASKET_ACCESS_LIST ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE WORKBASKET_ACCESS_LIST ALTER COLUMN WORKBASKET_ID TYPE VARCHAR(40); - -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE ATTACHMENT ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE ATTACHMENT ALTER COLUMN TASK_ID TYPE VARCHAR(40); - -ALTER TABLE ATTACHMENT ALTER COLUMN CLASSIFICATION_ID TYPE VARCHAR(40); - -ALTER TABLE TASK_COMMENT ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE TASK_COMMENT ALTER COLUMN TASK_ID TYPE VARCHAR(40); - -CREATE TABLE CONFIGURATION ( - ENFORCE_SECURITY BOOLEAN NOT NULL -); - --- TSK-1227 allow null values in OBJECT_REFERENCE#SYSTEM and OBJECT_REFERENCE#SYSTEM_INSTANCE - -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN SYSTEM DROP NOT NULL; -ALTER TABLE OBJECT_REFERENCE ALTER COLUMN SYSTEM_INSTANCE DROP NOT NULL; - -ALTER TABLE TASK ALTER COLUMN POR_SYSTEM DROP NOT NULL; -ALTER TABLE TASK ALTER COLUMN POR_INSTANCE DROP NOT NULL; - - diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_3.0.0_to_4.0.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_3.0.0_to_4.0.0_postgres.sql deleted file mode 100644 index 043afa95bb..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_3.0.0_to_4.0.0_postgres.sql +++ /dev/null @@ -1,65 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and HISTORY_EVENTS. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE HISTORY_EVENTS ALTER COLUMN ID DROP IDENTITY; - -ALTER TABLE HISTORY_EVENTS ALTER COLUMN ID TYPE VARCHAR(40); - -ALTER TABLE HISTORY_EVENTS RENAME TO TASK_HISTORY_EVENT; - -UPDATE TASK_HISTORY_EVENT SET ID = REPLACE(ID,'HEI','THI') WHERE ID LIKE '%HEI%'; - -CREATE TABLE WORKBASKET_HISTORY_EVENT -( - ID VARCHAR(40) NOT NULL, - WORKBASKET_ID VARCHAR(40) NULL, - EVENT_TYPE VARCHAR(40) NULL, - CREATED TIMESTAMP NULL, - USER_ID VARCHAR(32) NULL, - DOMAIN VARCHAR(32) NULL, - KEY VARCHAR(64) NULL, - TYPE VARCHAR(64) NULL, - OWNER VARCHAR(128) NULL, - CUSTOM_1 VARCHAR(255) NULL, - CUSTOM_2 VARCHAR(255) NULL, - CUSTOM_3 VARCHAR(255) NULL, - CUSTOM_4 VARCHAR(255) NULL, - ORGLEVEL_1 VARCHAR(255) NULL, - ORGLEVEL_2 VARCHAR(255) NULL, - ORGLEVEL_3 VARCHAR(255) NULL, - ORGLEVEL_4 VARCHAR(255) NULL, - DETAILS TEXT NULL, - PRIMARY KEY (ID) -); - -CREATE TABLE CLASSIFICATION_HISTORY_EVENT -( - ID VARCHAR(40) NOT NULL, - EVENT_TYPE VARCHAR(40) NULL, - CREATED TIMESTAMP NULL, - USER_ID VARCHAR(32) NULL, - CLASSIFICATION_ID VARCHAR(40) NULL, - APPLICATION_ENTRY_POINT VARCHAR(255) NULL, - CATEGORY VARCHAR(64) NULL, - DOMAIN VARCHAR(32) NULL, - KEY VARCHAR(40) NULL, - NAME VARCHAR(255) NULL, - PARENT_ID VARCHAR(40) NOT NULL, - PARENT_KEY VARCHAR(32) NOT NULL, - PRIORITY INT NOT NULL, - SERVICE_LEVEL VARCHAR(255) NULL, - TYPE VARCHAR(32), - CUSTOM_1 VARCHAR(255) NULL, - CUSTOM_2 VARCHAR(255) NULL, - CUSTOM_3 VARCHAR(255) NULL, - CUSTOM_4 VARCHAR(255) NULL, - CUSTOM_5 VARCHAR(255) NULL, - CUSTOM_6 VARCHAR(255) NULL, - CUSTOM_7 VARCHAR(255) NULL, - CUSTOM_8 VARCHAR(255) NULL, - DETAILS TEXT NULL, - PRIMARY KEY (ID) -); diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.0.0_to_4.3.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.0.0_to_4.3.0_postgres.sql deleted file mode 100644 index 642168a939..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.0.0_to_4.3.0_postgres.sql +++ /dev/null @@ -1,7 +0,0 @@ --- this script updates the tables KADAI_SCHEMA_VERSION and ATTACHMENT. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP); - -ALTER TABLE ATTACHMENT ALTER COLUMN REF_SYSTEM DROP NOT NULL, ALTER COLUMN REF_INSTANCE DROP NOT NULL; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.11.0_to_5.0.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.11.0_to_5.0.0_postgres.sql deleted file mode 100644 index d488cd2f6a..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.11.0_to_5.0.0_postgres.sql +++ /dev/null @@ -1,89 +0,0 @@ --- this script updates the KADAI database schema from version 4.11.0 to version 5.0.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.0.0', CURRENT_TIMESTAMP); - -ALTER TABLE OBJECT_REFERENCE ADD COLUMN TASK_ID VARCHAR(40) NOT NULL DEFAULT 'EMPTY'; - -DROP INDEX IF EXISTS IDX_CLASSIFICATION_1; -CREATE INDEX IDX_CLASSIFICATION_ID ON CLASSIFICATION - (ID ASC, CUSTOM_8, CUSTOM_7, CUSTOM_6, CUSTOM_5, CUSTOM_4, - CUSTOM_3, CUSTOM_2, CUSTOM_1, APPLICATION_ENTRY_POINT, - SERVICE_LEVEL, PRIORITY, DESCRIPTION, NAME, MODIFIED, - CREATED, VALID_IN_DOMAIN, DOMAIN, TYPE, CATEGORY, PARENT_KEY, - PARENT_ID, KEY); -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_CLASSIFICATION_2; -CREATE INDEX IDX_CLASSIFICATION_CATEGORY ON CLASSIFICATION - (CATEGORY ASC, DOMAIN ASC, TYPE ASC, CUSTOM_1 - ASC, CUSTOM_8 ASC, CUSTOM_7 ASC, CUSTOM_6 ASC, - CUSTOM_5 ASC, CUSTOM_4 ASC, CUSTOM_3 ASC, CUSTOM_2 - ASC, APPLICATION_ENTRY_POINT ASC, SERVICE_LEVEL - ASC, PRIORITY ASC, DESCRIPTION ASC, NAME ASC, - CREATED ASC, VALID_IN_DOMAIN ASC, PARENT_KEY ASC, PARENT_ID - ASC, KEY ASC, ID ASC); -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_CLASSIFICATION_3; -CREATE INDEX IDX_CLASSIFICATION_KEY_DOMAIN ON CLASSIFICATION - (KEY ASC, DOMAIN ASC, CUSTOM_8, CUSTOM_7, CUSTOM_6, - CUSTOM_5, CUSTOM_4, CUSTOM_3, CUSTOM_2, CUSTOM_1, - APPLICATION_ENTRY_POINT, SERVICE_LEVEL, PRIORITY, - DESCRIPTION, NAME, CREATED, VALID_IN_DOMAIN, - TYPE, CATEGORY, PARENT_KEY, PARENT_ID, ID) ; -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_TASK_1; -CREATE INDEX IDX_TASK_WORKBASKET_KEY_DOMAIN ON TASK - (WORKBASKET_KEY ASC, DOMAIN DESC); -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_TASK_2; -CREATE INDEX IDX_TASK_POR_VALUE ON TASK - (LOWER(POR_VALUE) ASC, WORKBASKET_ID ASC); -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_ATTACHMENT_1; -DROP INDEX IF EXISTS IDX_ATTACHMENT_2; -CREATE INDEX IDX_ATTACHMENT_TASK_ID ON ATTACHMENT - (TASK_ID ASC, RECEIVED ASC, CLASSIFICATION_ID - ASC, CLASSIFICATION_KEY ASC, MODIFIED ASC, CREATED - ASC, ID ASC) ; -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_WORKBASKET_1; -CREATE INDEX IDX_WORKBASKET_ID ON WORKBASKET - (ID ASC, ORG_LEVEL_4, ORG_LEVEL_3, ORG_LEVEL_2, - ORG_LEVEL_1, OWNER, DESCRIPTION, TYPE, DOMAIN, NAME, KEY); -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_WORKBASKET_2; -CREATE INDEX IDX_WORKBASKET_KEY_DOMAIN ON WORKBASKET - (KEY ASC, DOMAIN ASC, ORG_LEVEL_4, - ORG_LEVEL_3, ORG_LEVEL_2, ORG_LEVEL_1, CUSTOM_4, - CUSTOM_3, CUSTOM_2, CUSTOM_1, OWNER, DESCRIPTION, - TYPE, NAME, MODIFIED, CREATED, ID) ; -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_WORKBASKET_3; -CREATE INDEX IDX_WORKBASKET_KEY_DOMAIN_ID ON WORKBASKET - (KEY ASC, DOMAIN ASC, ID) ; - COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_WBAL_1; -CREATE INDEX IDX_WORKBASKET_ACCESS_LIST_ACCESS_ID ON WORKBASKET_ACCESS_LIST - (ACCESS_ID ASC, WORKBASKET_ID ASC, PERM_READ ASC) ; -COMMIT WORK ; - -DROP INDEX IF EXISTS IDX_WBAL_2; -CREATE INDEX IDX_WORKBASKET_ACCESS_LIST_WORKBASKET_ID ON WORKBASKET_ACCESS_LIST - (WORKBASKET_ID ASC, PERM_CUSTOM_12 ASC, PERM_CUSTOM_11 - ASC, PERM_CUSTOM_10 ASC, PERM_CUSTOM_9 ASC, PERM_CUSTOM_8 - ASC, PERM_CUSTOM_7 ASC, PERM_CUSTOM_6 ASC, PERM_CUSTOM_5 - ASC, PERM_CUSTOM_4 ASC, PERM_CUSTOM_3 ASC, PERM_CUSTOM_2 - ASC, PERM_CUSTOM_1 ASC, PERM_DISTRIBUTE ASC, PERM_TRANSFER - ASC, PERM_APPEND ASC, PERM_OPEN ASC, PERM_READ - ASC, ACCESS_ID ASC) ; -COMMIT WORK ; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.3.0_to_4.8.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.3.0_to_4.8.0_postgres.sql deleted file mode 100644 index 29c2d7ea82..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.3.0_to_4.8.0_postgres.sql +++ /dev/null @@ -1,47 +0,0 @@ --- this script updates the KADAI database schema from version 4.3.0 to version 4.8.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.8.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK ADD COLUMN RECEIVED TIMESTAMP NULL; -ALTER TABLE TASK ADD COLUMN MANUAL_PRIORITY INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_1 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_2 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_3 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_4 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_5 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_6 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_7 INT NULL; -ALTER TABLE TASK ADD COLUMN CUSTOM_INT_8 INT NULL; - -ALTER TABLE CONFIGURATION ADD COLUMN CUSTOM_ATTRIBUTES TEXT NULL; - -ALTER TABLE SCHEDULED_JOB ALTER COLUMN TYPE SET DATA TYPE VARCHAR(255); - -ALTER TABLE CLASSIFICATION ALTER COLUMN DOMAIN SET DATA TYPE VARCHAR(32); - -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_PRIORITY INT NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_PLANNED TIMESTAMP NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_DUE TIMESTAMP NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_OWNER VARCHAR(32) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN TASK_CLASSIFICATION_NAME VARCHAR(255) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN ATTACHMENT_CLASSIFICATION_NAME VARCHAR(255) NULL; -ALTER TABLE TASK_HISTORY_EVENT ADD COLUMN WORKBASKET_NAME VARCHAR(255) NULL; - -CREATE TABLE USER_INFO ( - USER_ID VARCHAR(32) NOT NULL, - FIRST_NAME VARCHAR(32) NULL, - LASTNAME VARCHAR(32) NULL, - FULL_NAME VARCHAR(64) NULL, - LONG_NAME VARCHAR(64) NULL, - E_MAIL VARCHAR(64) NULL, - PHONE VARCHAR(32) NULL, - MOBILE_PHONE VARCHAR(32) NULL, - ORG_LEVEL_4 VARCHAR(32) NULL, - ORG_LEVEL_3 VARCHAR(32) NULL, - ORG_LEVEL_2 VARCHAR(32) NULL, - ORG_LEVEL_1 VARCHAR(32) NULL, - DATA TEXT NULL, - PRIMARY KEY (USER_ID) -); diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.8.0_to_4.11.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.8.0_to_4.11.0_postgres.sql deleted file mode 100644 index dfcc6931a9..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_4.8.0_to_4.11.0_postgres.sql +++ /dev/null @@ -1,43 +0,0 @@ --- this script updates the KADAI database schema from version 4.8.0 to version 4.11.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.11.0', CURRENT_TIMESTAMP); - -ALTER TABLE CONFIGURATION ADD COLUMN NAME VARCHAR(8) NOT NULL DEFAULT 'MASTER'; -ALTER TABLE CONFIGURATION ALTER COLUMN ENFORCE_SECURITY DROP NOT NULL; -ALTER TABLE CONFIGURATION ALTER COLUMN NAME DROP DEFAULT; -ALTER TABLE CONFIGURATION ADD PRIMARY KEY (NAME); - -INSERT INTO CONFIGURATION (NAME) VALUES ('MASTER') ON CONFLICT DO NOTHING; - -UPDATE TASK SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE TASK SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE TASK SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE TASK SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; -UPDATE TASK SET CUSTOM_5 = '' WHERE CUSTOM_5 IS NULL; -UPDATE TASK SET CUSTOM_6 = '' WHERE CUSTOM_6 IS NULL; -UPDATE TASK SET CUSTOM_7 = '' WHERE CUSTOM_7 IS NULL; -UPDATE TASK SET CUSTOM_8 = '' WHERE CUSTOM_8 IS NULL; -UPDATE TASK SET CUSTOM_9 = '' WHERE CUSTOM_9 IS NULL; -UPDATE TASK SET CUSTOM_10 = '' WHERE CUSTOM_10 IS NULL; -UPDATE TASK SET CUSTOM_11 = '' WHERE CUSTOM_11 IS NULL; -UPDATE TASK SET CUSTOM_12 = '' WHERE CUSTOM_12 IS NULL; -UPDATE TASK SET CUSTOM_13 = '' WHERE CUSTOM_13 IS NULL; -UPDATE TASK SET CUSTOM_14 = '' WHERE CUSTOM_14 IS NULL; -UPDATE TASK SET CUSTOM_15 = '' WHERE CUSTOM_15 IS NULL; -UPDATE TASK SET CUSTOM_16 = '' WHERE CUSTOM_16 IS NULL; - -UPDATE WORKBASKET SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE WORKBASKET SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE WORKBASKET SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE WORKBASKET SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; - -UPDATE CLASSIFICATION SET CUSTOM_1 = '' WHERE CUSTOM_1 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_2 = '' WHERE CUSTOM_2 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_3 = '' WHERE CUSTOM_3 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_4 = '' WHERE CUSTOM_4 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_5 = '' WHERE CUSTOM_5 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_6 = '' WHERE CUSTOM_6 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_7 = '' WHERE CUSTOM_7 IS NULL; -UPDATE CLASSIFICATION SET CUSTOM_8 = '' WHERE CUSTOM_8 IS NULL; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.0.0_to_5.1.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.0.0_to_5.1.0_postgres.sql deleted file mode 100644 index dc50f43793..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.0.0_to_5.1.0_postgres.sql +++ /dev/null @@ -1,14 +0,0 @@ --- this script updates the KADAI database schema from version 5.0.0 to version 5.1.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.1.0', CURRENT_TIMESTAMP); - -DROP INDEX IF EXISTS IDX_TASK_POR_VALUE; - - CREATE INDEX IDX_TASK_LOWER_POR_VALUE ON TASK - (LOWER(POR_VALUE) ASC, WORKBASKET_ID ASC); - COMMIT WORK ; - CREATE INDEX IDX_TASK_POR_VALUE ON TASK - (POR_VALUE ASC, WORKBASKET_ID ASC); - COMMIT WORK ; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.1.0_to_5.2.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.1.0_to_5.2.0_postgres.sql deleted file mode 100644 index 63c9805ada..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.1.0_to_5.2.0_postgres.sql +++ /dev/null @@ -1,14 +0,0 @@ --- this script updates the KADAI database schema from version 5.1.0 to version 5.2.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (VERSION, CREATED) VALUES ('5.2.0', CURRENT_TIMESTAMP); - -CREATE TABLE GROUP_INFO -( - USER_ID VARCHAR(32) NOT NULL, - GROUP_ID VARCHAR(256) NOT NULL, - PRIMARY KEY (USER_ID, GROUP_ID) -); - -ALTER TABLE SCHEDULED_JOB ALTER COLUMN LOCKED_BY SET DATA TYPE VARCHAR(128); diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.10.0_to_6.2.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.10.0_to_6.2.0_postgres.sql deleted file mode 100644 index ea37182361..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.10.0_to_6.2.0_postgres.sql +++ /dev/null @@ -1,20 +0,0 @@ --- this script updates the KADAI database schema from version 5.10.0 to version 6.2.0. -SET -search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '6.2.0', CURRENT_TIMESTAMP); - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN PERM_READTASKS BOOLEAN NOT NULL DEFAULT FALSE; -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_READTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER COLUMN PERM_READTASKS DROP DEFAULT; - -ALTER TABLE WORKBASKET_ACCESS_LIST - ADD COLUMN PERM_EDITTASKS BOOLEAN NOT NULL DEFAULT FALSE; -UPDATE WORKBASKET_ACCESS_LIST -SET PERM_EDITTASKS=PERM_READ; -ALTER TABLE WORKBASKET_ACCESS_LIST - ALTER COLUMN PERM_EDITTASKS DROP DEFAULT; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.2.0_to_5.10.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.2.0_to_5.10.0_postgres.sql deleted file mode 100644 index 230ab1aa10..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_5.2.0_to_5.10.0_postgres.sql +++ /dev/null @@ -1,25 +0,0 @@ --- this script updates the KADAI database schema from version 5.2.0 to version 5.10.0. -SET SCHEMA %schemaName%; - -SET search_path = %schemaName%; - -ALTER TABLE KADAI_SCHEMA_VERSION ALTER COLUMN ID DROP IDENTITY; - -CREATE SEQUENCE KADAI_SCHEMA_VERSION_ID_SEQ - MINVALUE 1 - START WITH 100 - INCREMENT BY 1 CACHE 10; - --- The VERSION value must be equal or higher then the value of KadaiEngineImpl.MINIMAL_KADAI_SCHEMA_VERSION -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '5.10.0', CURRENT_TIMESTAMP); - -CREATE INDEX IDX_OBJECT_REFERE_PK_ID ON OBJECT_REFERENCE - (ID ASC); -COMMIT WORK ; -CREATE INDEX IDX_OBJECT_REFERE_FK_TASK_ID ON OBJECT_REFERENCE - (TASK_ID ASC); -COMMIT WORK ; -CREATE INDEX IDX_OBJECT_REFERE_ACCESS_LIST ON OBJECT_REFERENCE - (VALUE ASC, TYPE ASC, SYSTEM_INSTANCE ASC, SYSTEM ASC, COMPANY ASC, ID ASC); -COMMIT WORK ; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_6.2.0_to_7.0.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_6.2.0_to_7.0.0_postgres.sql deleted file mode 100644 index 7195f2845d..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_6.2.0_to_7.0.0_postgres.sql +++ /dev/null @@ -1,23 +0,0 @@ --- this script updates the KADAI database schema from version 6.2.0 to version 7.0.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP); - -CREATE TABLE PERMISSION_INFO -( - USER_ID VARCHAR(32) NOT NULL, - PERMISSION_ID VARCHAR(256) NOT NULL, - PRIMARY KEY (USER_ID, PERMISSION_ID) -); - -ALTER TABLE WORKBASKET - ADD COLUMN CUSTOM_5 VARCHAR(255) NULL, - ADD COLUMN CUSTOM_6 VARCHAR(255) NULL, - ADD COLUMN CUSTOM_7 VARCHAR(255) NULL, - ADD COLUMN CUSTOM_8 VARCHAR(255) NULL; - -CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT - (TASK_ID ASC); -COMMIT WORK ; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_7.0.0_to_7.1.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_7.0.0_to_7.1.0_postgres.sql deleted file mode 100644 index 96016b68eb..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_7.0.0_to_7.1.0_postgres.sql +++ /dev/null @@ -1,20 +0,0 @@ --- this script updates the KADAI database schema from version 7.0.0 to version 7.1.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT -FROM ( - SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT - FROM TASK t - RIGHT OUTER JOIN TASK_COMMENT tc - ON t.ID = tc.TASK_ID - GROUP BY t.ID -) AS subquery -WHERE t.ID = subquery.ID; diff --git a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_8.1.0_to_8.2.0_postgres.sql b/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_8.1.0_to_8.2.0_postgres.sql deleted file mode 100644 index e6ca95cfca..0000000000 --- a/common/kadai-common/src/main/resources/sql/postgres/kadai_schema_update_8.1.0_to_8.2.0_postgres.sql +++ /dev/null @@ -1,20 +0,0 @@ --- this script updates the KADAI database schema from version 8.1.0 to version 8.2.0. - -SET search_path = %schemaName%; - -INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP); - -ALTER TABLE TASK - ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0; - -UPDATE TASK t -SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT -FROM ( - SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT - FROM TASK t - RIGHT OUTER JOIN TASK_COMMENT tc - ON t.ID = tc.TASK_ID - GROUP BY t.ID -) AS subquery -WHERE t.ID = subquery.ID; \ No newline at end of file diff --git a/common/kadai-common/src/main/resources/sql/postgres/taskana_8.2.0_to_kadai_9.0.0_schema_update.sql b/common/kadai-common/src/main/resources/sql/postgres/taskana_8.2.0_to_kadai_9.0.0_schema_update.sql new file mode 100644 index 0000000000..748c6e7db6 --- /dev/null +++ b/common/kadai-common/src/main/resources/sql/postgres/taskana_8.2.0_to_kadai_9.0.0_schema_update.sql @@ -0,0 +1,16 @@ +-- this script updates the database schema from TASKANA version 8.2.0 to KADAI version 9.0.0. + +SET search_path = %schemaName%; + +ALTER TABLE taskana_schema_version + RENAME TO kadai_schema_version; + +ALTER TABLE kadai_schema_version + RENAME constraint taskana_schema_version_pkey TO kadai_schema_version_pkey; + +ALTER SEQUENCE taskana_schema_version_id_seq RENAME TO kadai_schema_version_id_seq; + +ALTER SEQUENCE kadai_schema_version_id_seq RESTART WITH 1000; + +INSERT INTO KADAI_SCHEMA_VERSION (ID, VERSION, CREATED) +VALUES (nextval('KADAI_SCHEMA_VERSION_ID_SEQ'), '9.0.0', CURRENT_TIMESTAMP); diff --git a/lib/kadai-core/src/main/java/io/kadai/common/api/KadaiEngine.java b/lib/kadai-core/src/main/java/io/kadai/common/api/KadaiEngine.java index defca928fd..166cda35df 100644 --- a/lib/kadai-core/src/main/java/io/kadai/common/api/KadaiEngine.java +++ b/lib/kadai-core/src/main/java/io/kadai/common/api/KadaiEngine.java @@ -17,7 +17,7 @@ /** The KadaiEngine represents an overall set of all needed services. */ public interface KadaiEngine { - String MINIMAL_KADAI_SCHEMA_VERSION = "7.1.0"; + String MINIMAL_KADAI_SCHEMA_VERSION = "9.0.0"; /** * This method creates the {@linkplain KadaiEngine} with {@linkplain diff --git a/lib/kadai-spring-example/src/main/java/io/kadai/example/KadaiConfig.java b/lib/kadai-spring-example/src/main/java/io/kadai/example/KadaiConfig.java index 3acfb88145..0788d96a41 100644 --- a/lib/kadai-spring-example/src/main/java/io/kadai/example/KadaiConfig.java +++ b/lib/kadai-spring-example/src/main/java/io/kadai/example/KadaiConfig.java @@ -26,7 +26,7 @@ @EnableTransactionManagement() public class KadaiConfig { - @Value("${kadai.schemaName:KADAI}") + @Value("${kadai.schemaName:TASKANA}") private String schemaName; @Bean diff --git a/rest/kadai-rest-spring-example-boot/src/main/resources/application.properties b/rest/kadai-rest-spring-example-boot/src/main/resources/application.properties index f09d17ccfd..792515ac3d 100644 --- a/rest/kadai-rest-spring-example-boot/src/main/resources/application.properties +++ b/rest/kadai-rest-spring-example-boot/src/main/resources/application.properties @@ -9,7 +9,7 @@ spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa springdoc.api-docs.path=/api-docs spring.datasource.password=sa -kadai.schemaName=KADAI +kadai.schemaName=TASKANA ######## h2 console configuration ######## ########spring.h2.console.enabled=true ########spring.h2.console.path=/h2-console