From: Jason Stephenson Date: Fri, 27 Jan 2023 18:49:29 +0000 (-0500) Subject: LP1902937: Modify New Schema Upgrade SQL scripts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fdyrcona%2Flp1902937-quipu-integration%2Berenew;p=working%2FEvergreen.git LP1902937: Modify New Schema Upgrade SQL scripts Alter schema upgrade that adds the erenew column to set the column "NOT NULL DEFAULT FALSE." Remove the extra updates to set the current column values to FALSE and add the NOT NULL constraint. This new version does it all in 1 ALTER TABLE statement. Rename the Quipu standing penalty and erenew pgt column upgrade scripts so that the order that they should be run is obvious from the filenames. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX-quipu-standing_penalty.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX-quipu-standing_penalty.sql deleted file mode 100644 index e7d82fd51b..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX-quipu-standing_penalty.sql +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN; - --- ID has to be under 100 in order to prevent it from appearing as a dropdown in the patron editor. - -INSERT INTO config.standing_penalty (id, name, label, staff_alert, org_depth) -VALUES (90, 'PATRON_TEMP_RENEWAL', - 'Patron was given a 30-day temporary account renewal. - Please archive this message after the account is fully renewed.', TRUE, 0 - ); - -COMMIT; \ No newline at end of file diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.erenew_column_pgt.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.erenew_column_pgt.sql deleted file mode 100644 index cf584015e7..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.erenew_column_pgt.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; - -ALTER TABLE permission.grp_tree ADD COLUMN erenew BOOL; - -COMMIT; - -BEGIN; - -UPDATE permission.grp_tree SET erenew = FALSE; - -COMMIT; - -BEGIN; - -ALTER TABLE permission.grp_tree ALTER COLUMN erenew SET NOT NULL; - -COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.quipu-standing-penalty.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.quipu-standing-penalty.sql new file mode 100644 index 0000000000..e7d82fd51b --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/YYYY.quipu-standing-penalty.sql @@ -0,0 +1,11 @@ +BEGIN; + +-- ID has to be under 100 in order to prevent it from appearing as a dropdown in the patron editor. + +INSERT INTO config.standing_penalty (id, name, label, staff_alert, org_depth) +VALUES (90, 'PATRON_TEMP_RENEWAL', + 'Patron was given a 30-day temporary account renewal. + Please archive this message after the account is fully renewed.', TRUE, 0 + ); + +COMMIT; \ No newline at end of file diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.schema.erenew_column_pgt.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.schema.erenew_column_pgt.sql new file mode 100644 index 0000000000..c047b32899 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.schema.erenew_column_pgt.sql @@ -0,0 +1,5 @@ +BEGIN; + +ALTER TABLE permission.grp_tree ADD COLUMN erenew BOOL NOT NULL DEFAULT FALSE; + +COMMIT;