[open-ils-commits] [GIT] Evergreen ILS branch master updated. 5b224b425c038436cd2026e6024e47bc8f65b007
Evergreen Git
git at git.evergreen-ils.org
Tue Aug 16 09:05:16 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, master has been updated
via 5b224b425c038436cd2026e6024e47bc8f65b007 (commit)
via fd2a63dbc409f859bb103abae24abfd55f324f18 (commit)
via ac36c3a6a2cc00a41834b88979f2d2a2c061818a (commit)
from ff7c382023385d80dc476f9e94d50bbf88763b2a (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 5b224b425c038436cd2026e6024e47bc8f65b007
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Aug 16 09:00:43 2011 -0400
Stamped upgrades for LP#825303
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 896eb6b..4261943 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,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 ('0599', :eg_version); -- miker/gmc
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0601', :eg_version); -- miker/gmc
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_cat_default_class_lookup.sql b/Open-ILS/src/sql/Pg/upgrade/0600.schema.fix_cat_default_class_lookup.sql
similarity index 93%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.fix_cat_default_class_lookup.sql
rename to Open-ILS/src/sql/Pg/upgrade/0600.schema.fix_cat_default_class_lookup.sql
index 5f52d89..418a78f 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_cat_default_class_lookup.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0600.schema.fix_cat_default_class_lookup.sql
@@ -7,7 +7,7 @@ BEGIN;
-- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0600', :eg_version);
CREATE OR REPLACE FUNCTION asset.label_normalizer() RETURNS TRIGGER AS $func$
DECLARE
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_aous_lookup.sql b/Open-ILS/src/sql/Pg/upgrade/0601.schema.fix_aous_lookup.sql
similarity index 93%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.fix_aous_lookup.sql
rename to Open-ILS/src/sql/Pg/upgrade/0601.schema.fix_aous_lookup.sql
index dc937be..3ca2c3b 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_aous_lookup.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0601.schema.fix_aous_lookup.sql
@@ -8,7 +8,7 @@ BEGIN;
-- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0601', :eg_version);
-- FIXME: add/check SQL statements to perform the upgrade
CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_setting( setting_name TEXT, org_id INT ) RETURNS SETOF actor.org_unit_setting AS $$
commit fd2a63dbc409f859bb103abae24abfd55f324f18
Author: Galen Charlton <gmc at esilibrary.com>
Date: Fri Aug 12 16:09:11 2011 -0400
return only the one applicable OU setting value
Correct actor.org_unit_ancestor_setting so that it returns
at most one setting value, rather than the entire set
of values defined for the OU and its ancestors.
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
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 c086a01..5653ded 100644
--- a/Open-ILS/src/sql/Pg/020.schema.functions.sql
+++ b/Open-ILS/src/sql/Pg/020.schema.functions.sql
@@ -314,6 +314,7 @@ BEGIN
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;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_aous_lookup.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_aous_lookup.sql
new file mode 100644
index 0000000..dc937be
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_aous_lookup.sql
@@ -0,0 +1,34 @@
+-- Evergreen DB patch XXXX.fix_aous_lookup.sql
+--
+-- Correct actor.org_unit_ancestor_setting so that it returns
+-- at most one setting value, rather than the entire set
+-- of values defined for the OU and its ancestors.
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+-- FIXME: add/check SQL statements to perform the upgrade
+CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_setting( setting_name TEXT, org_id INT ) RETURNS SETOF actor.org_unit_setting AS $$
+DECLARE
+ setting RECORD;
+ cur_org INT;
+BEGIN
+ 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;
+ RETURN;
+END;
+$$ LANGUAGE plpgsql STABLE ROWS 1;
+
+
+COMMIT;
commit ac36c3a6a2cc00a41834b88979f2d2a2c061818a
Author: Galen Charlton <gmc at esilibrary.com>
Date: Fri Aug 12 12:18:54 2011 -0400
lp#825303: fix cat.default_classification_scheme lookup
Fixes a bug where the wrong default classification scheme
could be chosen when adding a new volume whose classification
scheme was not explicitly set.
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql
index 4698e3f..ca584a1 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -262,9 +262,7 @@ BEGIN
NEW.label_class := COALESCE(
(
SELECT substring(value from E'\\d+')::integer
- FROM actor.org_unit_setting
- WHERE name = 'cat.default_classification_scheme'
- AND org_unit = NEW.owning_lib
+ FROM actor.org_unit_ancestor_setting('cat.default_classification_scheme', NEW.owning_lib)
), 1
);
END IF;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_cat_default_class_lookup.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_cat_default_class_lookup.sql
new file mode 100644
index 0000000..5f52d89
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_cat_default_class_lookup.sql
@@ -0,0 +1,38 @@
+-- Evergreen DB patch XXXX.fix_cat_default_class_lookup.sql
+--
+-- Fix LP#825303 by allowing for ancestor OUs to be checked
+-- when retrieving the default classification scheme.
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION asset.label_normalizer() RETURNS TRIGGER AS $func$
+DECLARE
+ sortkey TEXT := '';
+BEGIN
+ sortkey := NEW.label_sortkey;
+
+ IF NEW.label_class IS NULL THEN
+ NEW.label_class := COALESCE(
+ (
+ SELECT substring(value from E'\\d+')::integer
+ FROM actor.org_unit_ancestor_setting('cat.default_classification_scheme', NEW.owning_lib)
+ ), 1
+ );
+ END IF;
+
+ EXECUTE 'SELECT ' || acnc.normalizer || '(' ||
+ quote_literal( NEW.label ) || ')'
+ FROM asset.call_number_class acnc
+ WHERE acnc.id = NEW.label_class
+ INTO sortkey;
+ NEW.label_sortkey = sortkey;
+ RETURN NEW;
+END;
+$func$ LANGUAGE PLPGSQL;
+
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/020.schema.functions.sql | 1 +
Open-ILS/src/sql/Pg/040.schema.asset.sql | 4 +--
...> 0600.schema.fix_cat_default_class_lookup.sql} | 18 ++++++----
.../sql/Pg/upgrade/0601.schema.fix_aous_lookup.sql | 34 ++++++++++++++++++++
5 files changed, 48 insertions(+), 11 deletions(-)
copy Open-ILS/src/sql/Pg/upgrade/{0541.schema.call_number_honor_default_class.sql => 0600.schema.fix_cat_default_class_lookup.sql} (53%)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0601.schema.fix_aous_lookup.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list