Stamping upgrade script for making state not required
authorBen Shum <bshum@biblio.org>
Fri, 7 Jun 2013 20:21:07 +0000 (16:21 -0400)
committerBen Shum <bshum@biblio.org>
Fri, 7 Jun 2013 20:21:07 +0000 (16:21 -0400)
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0799.state_field_required_toggle.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.state_field_required_toggle.sql [deleted file]

index 1d0369a..7180d01 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 ('0798', :eg_version); -- tsbere/Dyrcona/dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0799', :eg_version); -- mrpeters/paxed/bshum
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0799.state_field_required_toggle.sql b/Open-ILS/src/sql/Pg/upgrade/0799.state_field_required_toggle.sql
new file mode 100644 (file)
index 0000000..6ac1315
--- /dev/null
@@ -0,0 +1,69 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0799', :eg_version);
+
+-- allow state to be null
+ALTER TABLE actor.usr_address ALTER COLUMN state DROP NOT NULL;
+
+-- create new YAOUS
+INSERT into config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES (
+        'ui.patron.edit.au.state.require',
+        'gui',
+        oils_i18n_gettext(
+            'ui.patron.edit.au.state.require',
+            'Require State field on patron registration',
+            'coust',
+            'label'
+        ),
+        oils_i18n_gettext(
+            'ui.patron.edit.au.state.require',
+            'The State field will be required on the patron registration screen.',
+            'coust',
+            'description'
+        ),
+        'bool'
+    );
+
+INSERT into config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES (
+        'ui.patron.edit.au.state.show',
+        'gui',
+        oils_i18n_gettext(
+            'ui.patron.edit.au.state.show',
+            'Show State field on patron registration',
+            'coust',
+            'label'
+        ),
+        oils_i18n_gettext(
+            'ui.patron.edit.au.state.show',
+            'The State field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.',
+            'coust',
+            'description'
+        ),
+        'bool'
+    ); 
+
+INSERT into config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES (
+        'ui.patron.edit.au.state.suggest',
+        'gui',
+        oils_i18n_gettext(
+            'ui.patron.edit.au.state.suggest',
+            'Suggest State field on patron registration',
+            'coust',
+            'label'
+        ),
+        oils_i18n_gettext(
+            'ui.patron.edit.au.state.suggest',
+            'The State field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.',
+            'coust',
+            'description'
+        ),
+        'bool'
+    );         
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.state_field_required_toggle.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.state_field_required_toggle.sql
deleted file mode 100644 (file)
index 9562259..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
--- allow state to be null
-ALTER TABLE actor.usr_address ALTER COLUMN state DROP NOT NULL;
-
--- create new YAOUS
-INSERT into config.org_unit_setting_type
-    (name, grp, label, description, datatype)
-    VALUES (
-        'ui.patron.edit.au.state.require',
-        'gui',
-        oils_i18n_gettext(
-            'ui.patron.edit.au.state.require',
-            'Require State field on patron registration',
-            'coust',
-            'label'
-        ),
-        oils_i18n_gettext(
-            'ui.patron.edit.au.state.require',
-            'The State field will be required on the patron registration screen.',
-            'coust',
-            'description'
-        ),
-        'bool'
-    );
-
-INSERT into config.org_unit_setting_type
-    (name, grp, label, description, datatype)
-    VALUES (
-        'ui.patron.edit.au.state.show',
-        'gui',
-        oils_i18n_gettext(
-            'ui.patron.edit.au.state.show',
-            'Show State field on patron registration',
-            'coust',
-            'label'
-        ),
-        oils_i18n_gettext(
-            'ui.patron.edit.au.state.show',
-            'The State field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.',
-            'coust',
-            'description'
-        ),
-        'bool'
-    ); 
-
-INSERT into config.org_unit_setting_type
-    (name, grp, label, description, datatype)
-    VALUES (
-        'ui.patron.edit.au.state.suggest',
-        'gui',
-        oils_i18n_gettext(
-            'ui.patron.edit.au.state.suggest',
-            'Suggest State field on patron registration',
-            'coust',
-            'label'
-        ),
-        oils_i18n_gettext(
-            'ui.patron.edit.au.state.suggest',
-            'The State field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.',
-            'coust',
-            'description'
-        ),
-        'bool'
-    );         
-
-COMMIT;