From: Galen Charlton Date: Tue, 9 Feb 2021 16:45:46 +0000 (-0500) Subject: LP#1786100: stamp schema update X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=834c617e1d30836b4b5ad627a1dbbb6c8baf8e60;p=evergreen%2Fpines.git LP#1786100: stamp schema update Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index b949ff0da9..e11f361450 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 ('1243', :eg_version); -- berick/ehardy +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1244', :eg_version); -- gmcharlt/rhamby CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1244.schema.fix_actcm_inh_fkey_trigger.sql b/Open-ILS/src/sql/Pg/upgrade/1244.schema.fix_actcm_inh_fkey_trigger.sql new file mode 100644 index 0000000000..743e7eedca --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1244.schema.fix_actcm_inh_fkey_trigger.sql @@ -0,0 +1,16 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1244', :eg_version); + +-- In some cases, asset.copy_tag_copy_map might have an inh_fkey() +-- trigger that fires on delete when it's not supposed to. This +-- update drops all inh_fkey triggers on that table and recreates +-- the known good version. +DROP TRIGGER IF EXISTS inherit_asset_copy_tag_copy_map_copy_fkey ON asset.copy_tag_copy_map; +DROP TRIGGER IF EXISTS inherit_copy_tag_copy_map_copy_fkey ON asset.copy_tag_copy_map; + +CREATE CONSTRAINT TRIGGER inherit_asset_copy_tag_copy_map_copy_fkey + AFTER UPDATE OR INSERT ON asset.copy_tag_copy_map + DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_tag_copy_map_copy_inh_fkey(); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actcm_inh_fkey_trigger.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actcm_inh_fkey_trigger.sql deleted file mode 100644 index 987e2b889c..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actcm_inh_fkey_trigger.sql +++ /dev/null @@ -1,16 +0,0 @@ -BEGIN; - --- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - --- In some cases, asset.copy_tag_copy_map might have an inh_fkey() --- trigger that fires on delete when it's not supposed to. This --- update drops all inh_fkey triggers on that table and recreates --- the known good version. -DROP TRIGGER IF EXISTS inherit_asset_copy_tag_copy_map_copy_fkey ON asset.copy_tag_copy_map; -DROP TRIGGER IF EXISTS inherit_copy_tag_copy_map_copy_fkey ON asset.copy_tag_copy_map; - -CREATE CONSTRAINT TRIGGER inherit_asset_copy_tag_copy_map_copy_fkey - AFTER UPDATE OR INSERT ON asset.copy_tag_copy_map - DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_tag_copy_map_copy_inh_fkey(); - -COMMIT;