From: Jason Stephenson Date: Fri, 17 Jul 2020 11:09:29 +0000 (-0400) Subject: LP#1886852: Stamping Upgrade Script X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=145f3da58aef1ef4163c29cd9d56a13146145090;p=evergreen%2Fpines.git LP#1886852: Stamping Upgrade Script Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 1a2298710c..f5b836e83b 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1205', :eg_version); -- sandbergja/tmcanna/gmcharlt +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1206', :eg_version); -- miker/dyrcona CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql b/Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql new file mode 100755 index 0000000000..a1ecf1b55c --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql @@ -0,0 +1,12 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1206', :eg_version); + +CREATE OR REPLACE FUNCTION + action.hold_request_regen_copy_maps( + hold_id INTEGER, copy_ids INTEGER[]) RETURNS VOID AS $$ + DELETE FROM action.hold_copy_map WHERE hold = $1; + INSERT INTO action.hold_copy_map (hold, target_copy) SELECT DISTINCT $1, UNNEST($2); +$$ LANGUAGE SQL; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql deleted file mode 100755 index 2d4739a48e..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -CREATE OR REPLACE FUNCTION - action.hold_request_regen_copy_maps( - hold_id INTEGER, copy_ids INTEGER[]) RETURNS VOID AS $$ - DELETE FROM action.hold_copy_map WHERE hold = $1; - INSERT INTO action.hold_copy_map (hold, target_copy) SELECT DISTINCT $1, UNNEST($2); -$$ LANGUAGE SQL; - -COMMIT;