[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. e3e5023061f3e686e4902d88ca39b37b78815b59
Evergreen Git
git at git.evergreen-ils.org
Tue Aug 23 14:40:32 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_2_0 has been updated
via e3e5023061f3e686e4902d88ca39b37b78815b59 (commit)
via d1fe1df3f295ee651f4f62864a0cc1c21c1dab9b (commit)
via 756851334c61c8132b49c127c7a1c7d271f5a2b9 (commit)
via 29c30703591cde0269f78984dda4509ddb02d327 (commit)
from e7db1d05e10d965c9515a7941d517ce541362ef2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e3e5023061f3e686e4902d88ca39b37b78815b59
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Aug 23 14:34:55 2011 -0400
2.[01]-stamped upgrade script for LP#816131
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 2183f19..48ea92b 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -57,7 +57,7 @@ CREATE TABLE config.upgrade_log (
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0605'); -- dbwells/dbs
+INSERT INTO config.upgrade_log (version) VALUES ('0607'); -- miker/jamesrf/tsbere
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql b/Open-ILS/src/sql/Pg/upgrade/0607.schema.oua_force_order.sql
similarity index 87%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql
rename to Open-ILS/src/sql/Pg/upgrade/0607.schema.oua_force_order.sql
index 9e14639..7a1afd6 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0607.schema.oua_force_order.sql
@@ -1,3 +1,7 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0607');
+
CREATE OR REPLACE FUNCTION actor.org_unit_ancestors( INT ) RETURNS SETOF actor.org_unit AS $$
WITH RECURSIVE org_unit_ancestors_distance(id, distance) AS (
SELECT $1, 0
@@ -9,3 +13,5 @@ CREATE OR REPLACE FUNCTION actor.org_unit_ancestors( INT ) RETURNS SETOF actor.o
SELECT ou.* FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad USING (id) ORDER BY ouad.distance DESC;
$$ LANGUAGE SQL ROWS 1;
+COMMIT;
+
commit d1fe1df3f295ee651f4f62864a0cc1c21c1dab9b
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Mon Aug 22 14:44:17 2011 -0400
Reverse direction of org_unit_ancestors
Apparently callers expect it to start at the top of the org tree.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/020.schema.functions.sql b/Open-ILS/src/sql/Pg/020.schema.functions.sql
index 964e4c5..8dfd8a2 100644
--- a/Open-ILS/src/sql/Pg/020.schema.functions.sql
+++ b/Open-ILS/src/sql/Pg/020.schema.functions.sql
@@ -242,7 +242,7 @@ CREATE OR REPLACE FUNCTION actor.org_unit_ancestors( INT ) RETURNS SETOF actor.o
FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad ON (ou.id = ouad.id)
WHERE ou.parent_ou IS NOT NULL
)
- SELECT ou.* FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad USING (id) ORDER BY ouad.distance;
+ SELECT ou.* FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad USING (id) ORDER BY ouad.distance DESC;
$$ LANGUAGE SQL ROWS 1;
CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_at_depth ( INT,INT ) RETURNS actor.org_unit AS $$
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql
index 84d864b..9e14639 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql
@@ -6,6 +6,6 @@ CREATE OR REPLACE FUNCTION actor.org_unit_ancestors( INT ) RETURNS SETOF actor.o
FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad ON (ou.id = ouad.id)
WHERE ou.parent_ou IS NOT NULL
)
- SELECT ou.* FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad USING (id) ORDER BY ouad.distance;
+ SELECT ou.* FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad USING (id) ORDER BY ouad.distance DESC;
$$ LANGUAGE SQL ROWS 1;
commit 756851334c61c8132b49c127c7a1c7d271f5a2b9
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Thu Aug 11 09:36:36 2011 -0400
Unwrapped upgrade script for oua_force_order
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql
new file mode 100644
index 0000000..84d864b
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.oua_force_order.sql
@@ -0,0 +1,11 @@
+CREATE OR REPLACE FUNCTION actor.org_unit_ancestors( INT ) RETURNS SETOF actor.org_unit AS $$
+ WITH RECURSIVE org_unit_ancestors_distance(id, distance) AS (
+ SELECT $1, 0
+ UNION
+ SELECT ou.parent_ou, ouad.distance+1
+ FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad ON (ou.id = ouad.id)
+ WHERE ou.parent_ou IS NOT NULL
+ )
+ SELECT ou.* FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad USING (id) ORDER BY ouad.distance;
+$$ LANGUAGE SQL ROWS 1;
+
commit 29c30703591cde0269f78984dda4509ddb02d327
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Thu Aug 11 09:35:18 2011 -0400
New version of actor.org_unit_ancestors
Preserves order through joins
Basically actor.org_unit_ancestors_distance with a join to get the
entire org units, rather than just IDs and a distance.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/020.schema.functions.sql b/Open-ILS/src/sql/Pg/020.schema.functions.sql
index 8c2c1a2..964e4c5 100644
--- a/Open-ILS/src/sql/Pg/020.schema.functions.sql
+++ b/Open-ILS/src/sql/Pg/020.schema.functions.sql
@@ -235,17 +235,14 @@ CREATE OR REPLACE FUNCTION actor.org_unit_descendants_distance( INT ) RETURNS TA
$$ LANGUAGE SQL STABLE ROWS 1;
CREATE OR REPLACE FUNCTION actor.org_unit_ancestors( INT ) RETURNS SETOF actor.org_unit AS $$
- WITH RECURSIVE anscestor_depth AS (
- SELECT ou.id,
- ou.parent_ou
- FROM actor.org_unit ou
- WHERE ou.id = $1
- UNION ALL
- SELECT ou.id,
- ou.parent_ou
- FROM actor.org_unit ou
- JOIN anscestor_depth ot ON (ot.parent_ou = ou.id)
- ) SELECT ou.* FROM actor.org_unit ou JOIN anscestor_depth USING (id);
+ WITH RECURSIVE org_unit_ancestors_distance(id, distance) AS (
+ SELECT $1, 0
+ UNION
+ SELECT ou.parent_ou, ouad.distance+1
+ FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad ON (ou.id = ouad.id)
+ WHERE ou.parent_ou IS NOT NULL
+ )
+ SELECT ou.* FROM actor.org_unit ou JOIN org_unit_ancestors_distance ouad USING (id) ORDER BY ouad.distance;
$$ LANGUAGE SQL ROWS 1;
CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_at_depth ( INT,INT ) RETURNS actor.org_unit AS $$
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/020.schema.functions.sql | 19 ++++++++-----------
.../sql/Pg/upgrade/0607.schema.oua_force_order.sql | 17 +++++++++++++++++
3 files changed, 26 insertions(+), 12 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0607.schema.oua_force_order.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list