LP#1568195: Stamping upgrade script
authorMike Rylander <mrylander@gmail.com>
Thu, 28 Apr 2016 15:54:28 +0000 (11:54 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 28 Apr 2016 15:54:28 +0000 (11:54 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0978.schema.make_ous_batch_retrieve_func_nonvariadic.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.make_ous_batch_retrieve_func_nonvariadic.sql [deleted file]

index 95766bf..fc8f13e 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');
 
     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 ('0977', :eg_version); -- Callender/Dyrcona/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0978', :eg_version); -- gmcharlt/miker
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0978.schema.make_ous_batch_retrieve_func_nonvariadic.sql b/Open-ILS/src/sql/Pg/upgrade/0978.schema.make_ous_batch_retrieve_func_nonvariadic.sql
new file mode 100644 (file)
index 0000000..cbb7b1c
--- /dev/null
@@ -0,0 +1,36 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0978', :eg_version);
+
+-- note: it is not necessary to explicitly drop the previous VARIADIC
+-- version of this stored procedure; create or replace function...
+-- suffices.
+CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_setting_batch( org_id INT, setting_names TEXT[] ) RETURNS SETOF actor.org_unit_setting AS $$
+DECLARE
+    setting RECORD;
+    setting_name TEXT;
+    cur_org INT;
+BEGIN
+    FOREACH setting_name IN ARRAY setting_names
+    LOOP
+        cur_org := org_id;
+        LOOP
+            SELECT INTO setting * FROM actor.org_unit_setting WHERE org_unit = cur_org AND name = setting_name;
+            IF FOUND THEN
+                RETURN NEXT setting;
+                EXIT;
+            END IF;
+            SELECT INTO cur_org parent_ou FROM actor.org_unit WHERE id = cur_org;
+            EXIT WHEN cur_org IS NULL;
+        END LOOP;
+    END LOOP;
+    RETURN;
+END;
+$$ LANGUAGE plpgsql STABLE;
+
+COMMENT ON FUNCTION actor.org_unit_ancestor_setting_batch( INT,  TEXT[] ) IS $$
+For each setting name passed, search "up" the org_unit tree until
+we find the first occurrence of an org_unit_setting with the given name.
+$$;
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.make_ous_batch_retrieve_func_nonvariadic.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.make_ous_batch_retrieve_func_nonvariadic.sql
deleted file mode 100644 (file)
index f933345..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-BEGIN;
-
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
--- note: it is not necessary to explicitly drop the previous VARIADIC
--- version of this stored procedure; create or replace function...
--- suffices.
-CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_setting_batch( org_id INT, setting_names TEXT[] ) RETURNS SETOF actor.org_unit_setting AS $$
-DECLARE
-    setting RECORD;
-    setting_name TEXT;
-    cur_org INT;
-BEGIN
-    FOREACH setting_name IN ARRAY setting_names
-    LOOP
-        cur_org := org_id;
-        LOOP
-            SELECT INTO setting * FROM actor.org_unit_setting WHERE org_unit = cur_org AND name = setting_name;
-            IF FOUND THEN
-                RETURN NEXT setting;
-                EXIT;
-            END IF;
-            SELECT INTO cur_org parent_ou FROM actor.org_unit WHERE id = cur_org;
-            EXIT WHEN cur_org IS NULL;
-        END LOOP;
-    END LOOP;
-    RETURN;
-END;
-$$ LANGUAGE plpgsql STABLE;
-
-COMMENT ON FUNCTION actor.org_unit_ancestor_setting_batch( INT,  TEXT[] ) IS $$
-For each setting name passed, search "up" the org_unit tree until
-we find the first occurrence of an org_unit_setting with the given name.
-$$;
-
-COMMIT;