Stamping upgrade for Granular Staff Initials settings
authorMike Rylander <mrylander@gmail.com>
Tue, 18 Feb 2014 17:47:42 +0000 (12:47 -0500)
committerMike Rylander <mrylander@gmail.com>
Tue, 18 Feb 2014 17:47:42 +0000 (12:47 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0859.data.staff-initials-settings.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff-initials-settings.sql [deleted file]

index c9db384..28a8b6c 100644 (file)
@@ -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 (file)
index 0000000..3750fa9
--- /dev/null
@@ -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 (file)
index e38e75c..0000000
+++ /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;