forked from Taskana/taskana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes Taskana#2637 - add update scripts from 8.1 to 8.2
- Loading branch information
Showing
9 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...on/taskana-common/src/main/resources/sql/db2/taskana_schema_update_8.1.0_to_8.2.0_db2.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- this script updates the TASKANA database schema from version 8.1.0. to version 8.2.0. | ||
SET SCHEMA %schemaName%; | ||
|
||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) | ||
VALUES (TASKANA_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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
common/taskana-common/src/main/resources/sql/h2/taskana_schema_update_8.1.0_to_8.2.0_h2.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- this script updates the TASKANA database schema from version 8.1.0 to version 8.2.0. | ||
SET SCHEMA %schemaName%; | ||
|
||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) | ||
VALUES (nextval('TASKANA_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 | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...kana-common/src/main/resources/sql/oracle/taskana_schema_update_8.1.0_to_8.2.0_oracle.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- this script updates the TASKANA database schema from version 8.1.0 to version 8.2.0. | ||
ALTER SESSION SET CURRENT_SCHEMA = %schemaName%; | ||
|
||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) | ||
VALUES (nextval('TASKANA_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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...-common/src/main/resources/sql/postgres/taskana_schema_update_8.1.0_to_8.2.0_postgres.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- this script updates the TASKANA database schema from version 8.1.0 to version 8.2.0. | ||
|
||
SET search_path = %schemaName%; | ||
|
||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED) | ||
VALUES (nextval('TASKANA_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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters