LP#1552861: stamp database update
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 15 May 2017 21:03:28 +0000 (17:03 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 15 May 2017 21:03:28 +0000 (17:03 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1039.data.change_default_match_set_ous_type.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.change_default_match_set_ous_type.sql [deleted file]

index 7d4393a..febaca1 100644 (file)
@@ -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 ('1038', :eg_version); -- csharp/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1039', :eg_version); -- jeffdavis/gmcharlt
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1039.data.change_default_match_set_ous_type.sql b/Open-ILS/src/sql/Pg/upgrade/1039.data.change_default_match_set_ous_type.sql
new file mode 100644 (file)
index 0000000..46b3619
--- /dev/null
@@ -0,0 +1,38 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1039', :eg_version); -- jeffdavis/gmcharlt
+
+UPDATE config.org_unit_setting_type
+SET datatype = 'link', fm_class = 'vms'
+WHERE name = 'vandelay.default_match_set'
+AND   datatype = 'string'
+AND   fm_class IS NULL;
+
+\echo Existing vandelay.default_match_set that do not
+\echo correspond to match sets
+SELECT aou.shortname, aous.value
+FROM   actor.org_unit_setting aous
+JOIN   actor.org_unit aou ON (aou.id = aous.org_unit)
+WHERE  aous.name = 'vandelay.default_match_set'
+AND    (
+  value !~ '^"[0-9]+"$'
+  OR
+    oils_json_to_text(aous.value)::INT NOT IN (
+      SELECT id FROM vandelay.match_set
+    )
+);
+
+\echo And now deleting the bad values, as otherwise they
+\echo will break the Library Settings Editor.
+DELETE
+FROM actor.org_unit_setting aous
+WHERE  aous.name = 'vandelay.default_match_set'
+AND    (
+  value !~ '^"[0-9]+"$'
+  OR
+    oils_json_to_text(aous.value)::INT NOT IN (
+      SELECT id FROM vandelay.match_set
+    )
+);
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.change_default_match_set_ous_type.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.change_default_match_set_ous_type.sql
deleted file mode 100644 (file)
index 67ac116..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-BEGIN;
-
--- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-UPDATE config.org_unit_setting_type
-SET datatype = 'link', fm_class = 'vms'
-WHERE name = 'vandelay.default_match_set'
-AND   datatype = 'string'
-AND   fm_class IS NULL;
-
-\echo Existing vandelay.default_match_set that do not
-\echo correspond to match sets
-SELECT aou.shortname, aous.value
-FROM   actor.org_unit_setting aous
-JOIN   actor.org_unit aou ON (aou.id = aous.org_unit)
-WHERE  aous.name = 'vandelay.default_match_set'
-AND    (
-  value !~ '^"[0-9]+"$'
-  OR
-    oils_json_to_text(aous.value)::INT NOT IN (
-      SELECT id FROM vandelay.match_set
-    )
-);
-
-\echo And now deleting the bad values, as otherwise they
-\echo will break the Library Settings Editor.
-DELETE
-FROM actor.org_unit_setting aous
-WHERE  aous.name = 'vandelay.default_match_set'
-AND    (
-  value !~ '^"[0-9]+"$'
-  OR
-    oils_json_to_text(aous.value)::INT NOT IN (
-      SELECT id FROM vandelay.match_set
-    )
-);
-
-COMMIT;