Skip to content

Commit

Permalink
Closes #2336 - removed default for new columns in update scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerhagen committed Jul 26, 2023
1 parent 4614082 commit 73940f8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 73940f8

Please sign in to comment.