diff --git a/common/taskana-common/src/main/resources/sql/db2/taskana_schema_update_5.10.0_to_6.2.0_db2.sql b/common/taskana-common/src/main/resources/sql/db2/taskana_schema_update_5.10.0_to_6.2.0_db2.sql index 2b3169c155..e767fab81a 100644 --- a/common/taskana-common/src/main/resources/sql/db2/taskana_schema_update_5.10.0_to_6.2.0_db2.sql +++ b/common/taskana-common/src/main/resources/sql/db2/taskana_schema_update_5.10.0_to_6.2.0_db2.sql @@ -2,12 +2,18 @@ SET SCHEMA %schemaName%; INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '6.2.0', CURRENT_TIMESTAMP); +VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '6.2.0', CURRENT_TIMESTAMP); -ALTER TABLE WORKBASKET_ACCESS_LIST ADD COLUMN PERM_READTASKS SMALLINT NOT NULL DEFAULT 0; +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; -UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ; - -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 + 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/taskana-common/src/main/resources/sql/h2/taskana_schema_update_5.10.0_to_6.2.0_h2.sql b/common/taskana-common/src/main/resources/sql/h2/taskana_schema_update_5.10.0_to_6.2.0_h2.sql index 42d6bae9be..eeb153e0b3 100644 --- a/common/taskana-common/src/main/resources/sql/h2/taskana_schema_update_5.10.0_to_6.2.0_h2.sql +++ b/common/taskana-common/src/main/resources/sql/h2/taskana_schema_update_5.10.0_to_6.2.0_h2.sql @@ -4,10 +4,16 @@ SET SCHEMA %schemaName%; INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.2.0', CURRENT_TIMESTAMP); -ALTER TABLE WORKBASKET_ACCESS_LIST ADD COLUMN PERM_READTASKS SMALLINT NOT NULL DEFAULT 0; +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; -UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ; - -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 + 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/taskana-common/src/main/resources/sql/oracle/taskana_schema_update_5.10.0_to_6.2.0_oracle.sql b/common/taskana-common/src/main/resources/sql/oracle/taskana_schema_update_5.10.0_to_6.2.0_oracle.sql index 08499cdaeb..55aedcd99d 100644 --- a/common/taskana-common/src/main/resources/sql/oracle/taskana_schema_update_5.10.0_to_6.2.0_oracle.sql +++ b/common/taskana-common/src/main/resources/sql/oracle/taskana_schema_update_5.10.0_to_6.2.0_oracle.sql @@ -1,13 +1,20 @@ -- this script updates the TASKANA database schema from version 5.10.0 to version 6.2.0. -ALTER SESSION SET CURRENT_SCHEMA = %schemaName%; +ALTER +SESSION SET CURRENT_SCHEMA = %schemaName%; INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) -VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '6.2.0', CURRENT_TIMESTAMP); +VALUES (TASKANA_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)); +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; -UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ; - -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 + 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/taskana-common/src/main/resources/sql/postgres/taskana_schema_update_5.10.0_to_6.2.0_postgres.sql b/common/taskana-common/src/main/resources/sql/postgres/taskana_schema_update_5.10.0_to_6.2.0_postgres.sql index 9f3af8c84b..9f15fd9d4f 100644 --- a/common/taskana-common/src/main/resources/sql/postgres/taskana_schema_update_5.10.0_to_6.2.0_postgres.sql +++ b/common/taskana-common/src/main/resources/sql/postgres/taskana_schema_update_5.10.0_to_6.2.0_postgres.sql @@ -1,13 +1,20 @@ -- this script updates the TASKANA database schema from version 5.10.0 to version 6.2.0. -SET search_path = %schemaName%; +SET +search_path = %schemaName%; INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.2.0', CURRENT_TIMESTAMP); -ALTER TABLE WORKBASKET_ACCESS_LIST ADD COLUMN PERM_READTASKS BOOLEAN NOT NULL DEFAULT FALSE; +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; -UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ; - -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 + 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;