From: Galen Charlton Date: Fri, 11 Sep 2020 15:09:39 +0000 (-0400) Subject: LP#1851413: stamp schema update X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3cd5d354bd96443885245e2d6fa6e83a87b206c9;p=evergreen%2Ftadl.git LP#1851413: stamp schema update Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 69c38a71bc..17ac9d837b 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -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 index 0000000000..0e26a0f252 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1228.function.restore_full_path_order.sql @@ -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 index 6eb4cc3680..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.restore_full_path_order.sql +++ /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; -