[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. 675bf44a644c886467aa59563019b564777d2f51
Evergreen Git
git at git.evergreen-ils.org
Tue Aug 16 09:11:54 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 675bf44a644c886467aa59563019b564777d2f51 (commit)
via dfaa0791cbffbe4d625ace9812aa4a5d33366460 (commit)
via 1de396bceb1a22ba828f49d1f85bf52f1dec115a (commit)
from ac5515c92a74e89c485c31e46f8dd3d4b1accb53 (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 675bf44a644c886467aa59563019b564777d2f51
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Aug 16 09:04:09 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 f698180..9d51a0d 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 ('0592'); -- mrpeters-isl/miker
+INSERT INTO config.upgrade_log (version) VALUES ('0601'); -- 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..ad539be 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);
+INSERT INTO config.upgrade_log (version) VALUES ('0600');
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..9ab83f3 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);
+INSERT INTO config.upgrade_log (version) VALUES ('0601');
-- 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 dfaa0791cbffbe4d625ace9812aa4a5d33366460
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 981a364..8c2c1a2 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 1de396bceb1a22ba828f49d1f85bf52f1dec115a
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 acfa065..cfdb46f 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -194,9 +194,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