LP#1851413: stamp schema update
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 11 Sep 2020 15:09:39 +0000 (11:09 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 11 Sep 2020 15:09:39 +0000 (11:09 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1228.function.restore_full_path_order.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.function.restore_full_path_order.sql [deleted file]

index 69c38a7..17ac9d8 100644 (file)
@@ -92,7 +92,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 ('1227', :eg_version); -- berick/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1228', :eg_version); -- miker/rhamby/gmcharlt
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1228.function.restore_full_path_order.sql b/Open-ILS/src/sql/Pg/upgrade/1228.function.restore_full_path_order.sql
new file mode 100644 (file)
index 0000000..0e26a0f
--- /dev/null
@@ -0,0 +1,17 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1228', :eg_version);
+
+CREATE OR REPLACE FUNCTION actor.org_unit_full_path ( INT ) RETURNS SETOF actor.org_unit AS $$
+    SELECT  aou.*
+      FROM  actor.org_unit AS aou
+            JOIN (
+                (SELECT au.id, t.depth FROM actor.org_unit_ancestors($1) AS au JOIN actor.org_unit_type t ON (au.ou_type = t.id))
+                    UNION
+                (SELECT au.id, t.depth FROM actor.org_unit_descendants($1) AS au JOIN actor.org_unit_type t ON (au.ou_type = t.id))
+            ) AS ad ON (aou.id=ad.id)
+      ORDER BY ad.depth;
+$$ LANGUAGE SQL STABLE;
+
+COMMIT;
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.restore_full_path_order.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.restore_full_path_order.sql
deleted file mode 100644 (file)
index 6eb4cc3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-CREATE OR REPLACE FUNCTION actor.org_unit_full_path ( INT ) RETURNS SETOF actor.org_unit AS $$
-    SELECT  aou.*
-      FROM  actor.org_unit AS aou
-            JOIN (
-                (SELECT au.id, t.depth FROM actor.org_unit_ancestors($1) AS au JOIN actor.org_unit_type t ON (au.ou_type = t.id))
-                    UNION
-                (SELECT au.id, t.depth FROM actor.org_unit_descendants($1) AS au JOIN actor.org_unit_type t ON (au.ou_type = t.id))
-            ) AS ad ON (aou.id=ad.id)
-      ORDER BY ad.depth;
-$$ LANGUAGE SQL STABLE;
-
-COMMIT;
-