From: Galen Charlton Date: Mon, 7 Aug 2017 20:44:32 +0000 (-0400) Subject: LP#1075401: stamp DB update X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ad9f052688f3be18dd0b8829ab449cac5d810ee9;p=working%2FEvergreen.git LP#1075401: stamp DB 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 a928378072..6cc41db27a 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -90,7 +90,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 ('1048', :eg_version); -- phasefx/berick +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1049', :eg_version); -- mmorgan/stompro/gmcharlt CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1049.data.nullify_invalid_act.age_protect_act.circ_as_type.sql b/Open-ILS/src/sql/Pg/upgrade/1049.data.nullify_invalid_act.age_protect_act.circ_as_type.sql new file mode 100644 index 0000000000..5177b6defd --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1049.data.nullify_invalid_act.age_protect_act.circ_as_type.sql @@ -0,0 +1,35 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1049', :eg_version); -- mmorgan/stompro/gmcharlt + +\echo ----------------------------------------------------------- +\echo Setting invalid age_protect and circ_as_type entries to NULL, +\echo otherwise they will break the Serial Copy Templates editor. +\echo Please review any Serial Copy Templates listed below. +\echo +UPDATE asset.copy_template act +SET age_protect = NULL +FROM actor.org_unit aou +WHERE aou.id=act.owning_lib + AND act.age_protect NOT IN + ( + SELECT id FROM config.rule_age_hold_protect + ) +RETURNING act.id "Template ID", act.name "Template Name", + aou.shortname "Owning Lib", + 'Age Protection value reset to null.' "Description"; + +UPDATE asset.copy_template act +SET circ_as_type = NULL +FROM actor.org_unit aou +WHERE aou.id=act.owning_lib + AND act.circ_as_type NOT IN + ( + SELECT code FROM config.item_type_map + ) +RETURNING act.id "Template ID", act.name "Template Name", + aou.shortname "Owning Lib", + 'Circ as Type value reset to null.' as "Description"; + +\echo -----------End Serial Template Fix---------------- +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.nullify_invalid_act.age_protect_act.circ_as_type.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.nullify_invalid_act.age_protect_act.circ_as_type.sql deleted file mode 100644 index 7eafe1194a..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.nullify_invalid_act.age_protect_act.circ_as_type.sql +++ /dev/null @@ -1,35 +0,0 @@ -BEGIN; - --- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -\echo ----------------------------------------------------------- -\echo Setting invalid age_protect and circ_as_type entries to NULL, -\echo otherwise they will break the Serial Copy Templates editor. -\echo Please review any Serial Copy Templates listed below. -\echo -UPDATE asset.copy_template act -SET age_protect = NULL -FROM actor.org_unit aou -WHERE aou.id=act.owning_lib - AND act.age_protect NOT IN - ( - SELECT id FROM config.rule_age_hold_protect - ) -RETURNING act.id "Template ID", act.name "Template Name", - aou.shortname "Owning Lib", - 'Age Protection value reset to null.' "Description"; - -UPDATE asset.copy_template act -SET circ_as_type = NULL -FROM actor.org_unit aou -WHERE aou.id=act.owning_lib - AND act.circ_as_type NOT IN - ( - SELECT code FROM config.item_type_map - ) -RETURNING act.id "Template ID", act.name "Template Name", - aou.shortname "Owning Lib", - 'Circ as Type value reset to null.' as "Description"; - -\echo -----------End Serial Template Fix---------------- -COMMIT;