1 -- Evergreen DB patch 0859.data.staff-initials-settings.sql
3 -- More granular configuration settings for requiring use of staff initials
7 -- check whether patch can be applied
8 SELECT evergreen.upgrade_deps_block_check('0859', :eg_version);
10 -- add new granular settings for requiring use of staff initials
11 INSERT INTO config.org_unit_setting_type
12 (name, grp, label, description, datatype)
14 'ui.staff.require_initials.patron_standing_penalty',
17 'ui.staff.require_initials.patron_standing_penalty',
18 'Require staff initials for entry/edit of patron standing penalties and messages.',
23 'ui.staff.require_initials.patron_standing_penalty',
24 'Appends staff initials and edit date into patron standing penalties and messages.',
30 'ui.staff.require_initials.patron_info_notes',
33 'ui.staff.require_initials.patron_info_notes',
34 'Require staff initials for entry/edit of patron notes.',
39 'ui.staff.require_initials.patron_info_notes',
40 'Appends staff initials and edit date into patron note content.',
46 'ui.staff.require_initials.copy_notes',
49 'ui.staff.require_initials.copy_notes',
50 'Require staff initials for entry/edit of copy notes.',
55 'ui.staff.require_initials.copy_notes',
56 'Appends staff initials and edit date into copy note content..',
63 -- Update any existing setting so that the original set value is now passed to
64 -- one of the newer settings.
66 UPDATE actor.org_unit_setting
67 SET name = 'ui.staff.require_initials.patron_standing_penalty'
68 WHERE name = 'ui.staff.require_initials';
70 -- Add similar values for new settings as old ones to preserve existing configured
73 INSERT INTO actor.org_unit_setting (org_unit, name, value)
74 SELECT org_unit, 'ui.staff.require_initials.patron_info_notes', value
75 FROM actor.org_unit_setting
76 WHERE name = 'ui.staff.require_initials.patron_standing_penalty';
78 INSERT INTO actor.org_unit_setting (org_unit, name, value)
79 SELECT org_unit, 'ui.staff.require_initials.copy_notes', value
80 FROM actor.org_unit_setting
81 WHERE name = 'ui.staff.require_initials.patron_standing_penalty';
83 -- Update setting logs so that the original setting name's history is now transferred
84 -- over to one of the newer settings.
86 UPDATE config.org_unit_setting_type_log
87 SET field_name = 'ui.staff.require_initials.patron_standing_penalty'
88 WHERE field_name = 'ui.staff.require_initials';
90 -- Remove the old setting entirely
92 DELETE FROM config.org_unit_setting_type WHERE name = 'ui.staff.require_initials';