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 2d77857
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
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;

UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_READTASKS=PERM_READ;

ALTER TABLE WORKBASKET_ACCESS_LIST ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL DEFAULT 0;
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL;

UPDATE WORKBASKET_ACCESS_LIST SET PERM_EDITTASKS=PERM_READ;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ 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;

UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_READTASKS=PERM_READ;

ALTER TABLE WORKBASKET_ACCESS_LIST ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL DEFAULT 0;
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL;

UPDATE WORKBASKET_ACCESS_LIST SET PERM_EDITTASKS=PERM_READ;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
-- 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) NOT NULL CHECK (PERM_READTASKS IN (0,1));

UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ;
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));
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD PERM_EDITTASKS NUMBER(1) NOT NULL CHECK (PERM_EDITTASKS IN (0,1));

UPDATE WORKBASKET_ACCESS_LIST SET PERM_EDITTASKS=PERM_READ;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
-- 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;

UPDATE WORKBASKET_ACCESS_LIST SET PERM_READTASKS=PERM_READ;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_READTASKS=PERM_READ;

ALTER TABLE WORKBASKET_ACCESS_LIST ADD COLUMN PERM_EDITTASKS BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_EDITTASKS BOOLEAN NOT NULL;

UPDATE WORKBASKET_ACCESS_LIST SET PERM_EDITTASKS=PERM_READ;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;

0 comments on commit 2d77857

Please sign in to comment.