From: Mike Rylander Date: Tue, 18 Feb 2014 17:47:42 +0000 (-0500) Subject: Stamping upgrade for Granular Staff Initials settings X-Git-Tag: sprint4-merge-nov22~2308 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6d750a0023cc1197b460d2e254d1ba89c376f18a;p=working%2FEvergreen.git Stamping upgrade for Granular Staff Initials settings Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index c9db3846fc..28a8b6c4f3 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -91,7 +91,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 ('0858', :eg_version); -- senator/dbwells +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0859', :eg_version); -- bshum/miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0859.data.staff-initials-settings.sql b/Open-ILS/src/sql/Pg/upgrade/0859.data.staff-initials-settings.sql new file mode 100644 index 0000000000..3750fa98c2 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0859.data.staff-initials-settings.sql @@ -0,0 +1,94 @@ +-- Evergreen DB patch 0859.data.staff-initials-settings.sql +-- +-- More granular configuration settings for requiring use of staff initials +-- +BEGIN; + +-- check whether patch can be applied +SELECT evergreen.upgrade_deps_block_check('0859', :eg_version); + +-- add new granular settings for requiring use of staff initials +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES ( + 'ui.staff.require_initials.patron_standing_penalty', + 'gui', + oils_i18n_gettext( + 'ui.staff.require_initials.patron_standing_penalty', + 'Require staff initials for entry/edit of patron standing penalties and messages.', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'ui.staff.require_initials.patron_standing_penalty', + 'Appends staff initials and edit date into patron standing penalties and messages.', + 'coust', + 'description' + ), + 'bool' + ), ( + 'ui.staff.require_initials.patron_info_notes', + 'gui', + oils_i18n_gettext( + 'ui.staff.require_initials.patron_info_notes', + 'Require staff initials for entry/edit of patron notes.', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'ui.staff.require_initials.patron_info_notes', + 'Appends staff initials and edit date into patron note content.', + 'coust', + 'description' + ), + 'bool' + ), ( + 'ui.staff.require_initials.copy_notes', + 'gui', + oils_i18n_gettext( + 'ui.staff.require_initials.copy_notes', + 'Require staff initials for entry/edit of copy notes.', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'ui.staff.require_initials.copy_notes', + 'Appends staff initials and edit date into copy note content..', + 'coust', + 'description' + ), + 'bool' + ); + +-- Update any existing setting so that the original set value is now passed to +-- one of the newer settings. + +UPDATE actor.org_unit_setting +SET name = 'ui.staff.require_initials.patron_standing_penalty' +WHERE name = 'ui.staff.require_initials'; + +-- Add similar values for new settings as old ones to preserve existing configured +-- functionality. + +INSERT INTO actor.org_unit_setting (org_unit, name, value) +SELECT org_unit, 'ui.staff.require_initials.patron_info_notes', value +FROM actor.org_unit_setting +WHERE name = 'ui.staff.require_initials.patron_standing_penalty'; + +INSERT INTO actor.org_unit_setting (org_unit, name, value) +SELECT org_unit, 'ui.staff.require_initials.copy_notes', value +FROM actor.org_unit_setting +WHERE name = 'ui.staff.require_initials.patron_standing_penalty'; + +-- Update setting logs so that the original setting name's history is now transferred +-- over to one of the newer settings. + +UPDATE config.org_unit_setting_type_log +SET field_name = 'ui.staff.require_initials.patron_standing_penalty' +WHERE field_name = 'ui.staff.require_initials'; + +-- Remove the old setting entirely + +DELETE FROM config.org_unit_setting_type WHERE name = 'ui.staff.require_initials'; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff-initials-settings.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff-initials-settings.sql deleted file mode 100644 index e38e75cdeb..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff-initials-settings.sql +++ /dev/null @@ -1,94 +0,0 @@ --- Evergreen DB patch XXXX.data.staff-initials-settings.sql --- --- More granular configuration settings for requiring use of staff initials --- -BEGIN; - --- check whether patch can be applied -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - --- add new granular settings for requiring use of staff initials -INSERT INTO config.org_unit_setting_type - (name, grp, label, description, datatype) - VALUES ( - 'ui.staff.require_initials.patron_standing_penalty', - 'gui', - oils_i18n_gettext( - 'ui.staff.require_initials.patron_standing_penalty', - 'Require staff initials for entry/edit of patron standing penalties and messages.', - 'coust', - 'label' - ), - oils_i18n_gettext( - 'ui.staff.require_initials.patron_standing_penalty', - 'Appends staff initials and edit date into patron standing penalties and messages.', - 'coust', - 'description' - ), - 'bool' - ), ( - 'ui.staff.require_initials.patron_info_notes', - 'gui', - oils_i18n_gettext( - 'ui.staff.require_initials.patron_info_notes', - 'Require staff initials for entry/edit of patron notes.', - 'coust', - 'label' - ), - oils_i18n_gettext( - 'ui.staff.require_initials.patron_info_notes', - 'Appends staff initials and edit date into patron note content.', - 'coust', - 'description' - ), - 'bool' - ), ( - 'ui.staff.require_initials.copy_notes', - 'gui', - oils_i18n_gettext( - 'ui.staff.require_initials.copy_notes', - 'Require staff initials for entry/edit of copy notes.', - 'coust', - 'label' - ), - oils_i18n_gettext( - 'ui.staff.require_initials.copy_notes', - 'Appends staff initials and edit date into copy note content..', - 'coust', - 'description' - ), - 'bool' - ); - --- Update any existing setting so that the original set value is now passed to --- one of the newer settings. - -UPDATE actor.org_unit_setting -SET name = 'ui.staff.require_initials.patron_standing_penalty' -WHERE name = 'ui.staff.require_initials'; - --- Add similar values for new settings as old ones to preserve existing configured --- functionality. - -INSERT INTO actor.org_unit_setting (org_unit, name, value) -SELECT org_unit, 'ui.staff.require_initials.patron_info_notes', value -FROM actor.org_unit_setting -WHERE name = 'ui.staff.require_initials.patron_standing_penalty'; - -INSERT INTO actor.org_unit_setting (org_unit, name, value) -SELECT org_unit, 'ui.staff.require_initials.copy_notes', value -FROM actor.org_unit_setting -WHERE name = 'ui.staff.require_initials.patron_standing_penalty'; - --- Update setting logs so that the original setting name's history is now transferred --- over to one of the newer settings. - -UPDATE config.org_unit_setting_type_log -SET field_name = 'ui.staff.require_initials.patron_standing_penalty' -WHERE field_name = 'ui.staff.require_initials'; - --- Remove the old setting entirely - -DELETE FROM config.org_unit_setting_type WHERE name = 'ui.staff.require_initials'; - -COMMIT;