[open-ils-commits] [GIT] Evergreen ILS branch master updated. 71b298857646d89527d6f50d217ba696eebde3b9
Evergreen Git
git at git.evergreen-ils.org
Wed Jul 17 13:31:30 EDT 2013
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 71b298857646d89527d6f50d217ba696eebde3b9 (commit)
via 896184650f588f57b31bdc214d30007e86ae633f (commit)
via bc9ea5cafd18ea612bc9ccd271f2a64bd08656d2 (commit)
via a4266efb231ffd6df7fcfff5a65742d607c8c14c (commit)
from ae25f788e275d75d58dd0f0c91ba96d9ddf844ed (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 71b298857646d89527d6f50d217ba696eebde3b9
Author: Mike Rylander <mrylander at gmail.com>
Date: Wed Jul 17 13:29:14 2013 -0400
Stamping upgrade script for copy stats SP fix
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 f490fc8..68648b1 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,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 ('0810', :eg_version); -- senator/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0811', :eg_version); -- fparks/miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.copy_related_hold_stats.sql b/Open-ILS/src/sql/Pg/upgrade/0811.function.copy_related_hold_stats.sql
similarity index 96%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.function.copy_related_hold_stats.sql
rename to Open-ILS/src/sql/Pg/upgrade/0811.function.copy_related_hold_stats.sql
index a59b517..81b7b93 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.copy_related_hold_stats.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0811.function.copy_related_hold_stats.sql
@@ -1,7 +1,7 @@
BEGIN;
-- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0811', :eg_version);
DROP FUNCTION action.copy_related_hold_stats(integer);
commit 896184650f588f57b31bdc214d30007e86ae633f
Author: Fredrick Parks <fparks at catalystitservices.com>
Date: Wed Jul 10 11:12:17 2013 -0700
LP 1103706 Hold ratios in circ policies cause errors when trying to renew items
Changed the function action.copy_related_hold_stats to accept a bigint as the perameter instead of an integer.
Copy_related_hold_stats is only called by the function action.item_user_circ_test which trys to pass a bigint.
Signed-off-by: Fredrick Parks <fparks at catalystitservices.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/100.circ_matrix.sql b/Open-ILS/src/sql/Pg/100.circ_matrix.sql
index 643dd4e..93f7db0 100644
--- a/Open-ILS/src/sql/Pg/100.circ_matrix.sql
+++ b/Open-ILS/src/sql/Pg/100.circ_matrix.sql
@@ -365,7 +365,7 @@ CREATE TYPE action.hold_stats AS (
available_copy_ratio FLOAT
);
-CREATE OR REPLACE FUNCTION action.copy_related_hold_stats (copy_id INT) RETURNS action.hold_stats AS $func$
+CREATE OR REPLACE FUNCTION action.copy_related_hold_stats (copy_id BIGINT) RETURNS action.hold_stats AS $func$
DECLARE
output action.hold_stats%ROWTYPE;
hold_count INT := 0;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.copy_related_hold_stats.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.copy_related_hold_stats.sql
new file mode 100644
index 0000000..a59b517
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.copy_related_hold_stats.sql
@@ -0,0 +1,60 @@
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+DROP FUNCTION action.copy_related_hold_stats(integer);
+
+CREATE OR REPLACE FUNCTION action.copy_related_hold_stats(copy_id bigint)
+ RETURNS action.hold_stats AS
+$BODY$
+DECLARE
+ output action.hold_stats%ROWTYPE;
+ hold_count INT := 0;
+ copy_count INT := 0;
+ available_count INT := 0;
+ hold_map_data RECORD;
+BEGIN
+
+ output.hold_count := 0;
+ output.copy_count := 0;
+ output.available_count := 0;
+
+ SELECT COUNT( DISTINCT m.hold ) INTO hold_count
+ FROM action.hold_copy_map m
+ JOIN action.hold_request h ON (m.hold = h.id)
+ WHERE m.target_copy = copy_id
+ AND NOT h.frozen;
+
+ output.hold_count := hold_count;
+
+ IF output.hold_count > 0 THEN
+ FOR hold_map_data IN
+ SELECT DISTINCT m.target_copy,
+ acp.status
+ FROM action.hold_copy_map m
+ JOIN asset.copy acp ON (m.target_copy = acp.id)
+ JOIN action.hold_request h ON (m.hold = h.id)
+ WHERE m.hold IN ( SELECT DISTINCT hold FROM action.hold_copy_map WHERE target_copy = copy_id ) AND NOT h.frozen
+ LOOP
+ output.copy_count := output.copy_count + 1;
+ IF hold_map_data.status IN (0,7,12) THEN
+ output.available_count := output.available_count + 1;
+ END IF;
+ END LOOP;
+ output.total_copy_ratio = output.copy_count::FLOAT / output.hold_count::FLOAT;
+ output.available_copy_ratio = output.available_count::FLOAT / output.hold_count::FLOAT;
+
+ END IF;
+
+ RETURN output;
+
+END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE
+ COST 100;
+ALTER FUNCTION action.copy_related_hold_stats(bigint)
+ OWNER TO evergreen;
+
+COMMIT;
+
commit bc9ea5cafd18ea612bc9ccd271f2a64bd08656d2
Author: Mike Rylander <mrylander at gmail.com>
Date: Wed Jul 17 13:25:29 2013 -0400
Stamping upgrade script for authority labeling fix
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 9b831b9..f490fc8 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,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 ('0809', :eg_version); -- paxed/bshum
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0810', :eg_version); -- senator/miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority_4xx_fields.sql b/Open-ILS/src/sql/Pg/upgrade/0810.data.authority_4xx_fields.sql
similarity index 76%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority_4xx_fields.sql
rename to Open-ILS/src/sql/Pg/upgrade/0810.data.authority_4xx_fields.sql
index c6383f1..8398747 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority_4xx_fields.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0810.data.authority_4xx_fields.sql
@@ -1,7 +1,7 @@
BEGIN;
-- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0810', :eg_version);
UPDATE authority.control_set_authority_field
SET name = REGEXP_REPLACE(name, '^See Also', 'See From')
commit a4266efb231ffd6df7fcfff5a65742d607c8c14c
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date: Thu Jul 11 15:31:37 2013 -0400
Authorities: 4XX fields have wrong names
In Evergreen we have authority fields defined in the database that
relate to control sets. These are used somewhere today (I'm fuzzy on
that at the moment; some places once had and may still have hardcoded
labels) but they also will be used by the bib and auth browser
that's not yet merged to master (see LP #1177810).
The 4XX tags among the set I'm talking about (in
authority.control_set_authority_fields) are mislabled, saying See Also
where they ought to say See From, e.g.
http://www.loc.gov/marc/authority/ad400.html
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 0afe779..f6a42f4 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -10327,7 +10327,7 @@ INSERT INTO authority.control_set_authority_field (id, control_set, main_entry,
(4, 1, NULL, '130', 'adfgklmnoprstvxyz', oils_i18n_gettext('4','Heading -- Uniform Title','acsaf','name'), '2'),
(24, 1, 4, '530', 'adfgiklmnoprstvwxyz4', oils_i18n_gettext('24','See Also From Tracing -- Uniform Title','acsaf','name'), '2'),
(44, 1, 4, '730', 'adfghklmnoprstvwxyz25', oils_i18n_gettext('44','Established Heading Linking Entry -- Uniform Title','acsaf','name'), '2'),
- (64, 1, 4, '430', 'adfgiklmnoprstvwxyz4', oils_i18n_gettext('64','See Also Tracing -- Uniform Title','acsaf','name'), '2');
+ (64, 1, 4, '430', 'adfgiklmnoprstvwxyz4', oils_i18n_gettext('64','See From Tracing -- Uniform Title','acsaf','name'), '2');
INSERT INTO authority.control_set_authority_field (id, control_set, main_entry, tag, sf_list, name) VALUES
@@ -10371,17 +10371,17 @@ INSERT INTO authority.control_set_authority_field (id, control_set, main_entry,
(52, 1, 12, '748', 'avwxyz25', oils_i18n_gettext('52','Established Heading Linking Entry -- Chronological Term','acsaf','name')),
-- See From tracings
- (61, 1, 1, '400', 'abcdefiklmnopqrstvwxyz4', oils_i18n_gettext('61','See Also Tracing -- Personal Name','acsaf','name')),
- (62, 1, 2, '410', 'abcdefgiklmnoprstvwxyz4', oils_i18n_gettext('62','See Also Tracing -- Corporate Name','acsaf','name')),
- (63, 1, 3, '411', 'acdefgiklnpqstvwxyz4', oils_i18n_gettext('63','See Also Tracing -- Meeting Name','acsaf','name')),
- (65, 1, 5, '450', 'abivwxyz4', oils_i18n_gettext('65','See Also Tracing -- Topical Term','acsaf','name')),
- (66, 1, 6, '451', 'aivwxyz4', oils_i18n_gettext('66','See Also Tracing -- Geographic Name','acsaf','name')),
- (67, 1, 7, '455', 'aivwxyz4', oils_i18n_gettext('67','See Also Tracing -- Genre/Form Term','acsaf','name')),
- (68, 1, 8, '480', 'ivwxyz4', oils_i18n_gettext('68','See Also Tracing -- General Subdivision','acsaf','name')),
- (69, 1, 9, '481', 'ivwxyz4', oils_i18n_gettext('69','See Also Tracing -- Geographic Subdivision','acsaf','name')),
- (70, 1, 10, '482', 'ivwxyz4', oils_i18n_gettext('70','See Also Tracing -- Chronological Subdivision','acsaf','name')),
- (71, 1, 11, '485', 'ivwxyz4', oils_i18n_gettext('71','See Also Tracing -- Form Subdivision','acsaf','name')),
- (72, 1, 12, '448', 'aivwxyz4', oils_i18n_gettext('72','See Also Tracing -- Chronological Term','acsaf','name'));
+ (61, 1, 1, '400', 'abcdefiklmnopqrstvwxyz4', oils_i18n_gettext('61','See From Tracing -- Personal Name','acsaf','name')),
+ (62, 1, 2, '410', 'abcdefgiklmnoprstvwxyz4', oils_i18n_gettext('62','See From Tracing -- Corporate Name','acsaf','name')),
+ (63, 1, 3, '411', 'acdefgiklnpqstvwxyz4', oils_i18n_gettext('63','See From Tracing -- Meeting Name','acsaf','name')),
+ (65, 1, 5, '450', 'abivwxyz4', oils_i18n_gettext('65','See From Tracing -- Topical Term','acsaf','name')),
+ (66, 1, 6, '451', 'aivwxyz4', oils_i18n_gettext('66','See From Tracing -- Geographic Name','acsaf','name')),
+ (67, 1, 7, '455', 'aivwxyz4', oils_i18n_gettext('67','See From Tracing -- Genre/Form Term','acsaf','name')),
+ (68, 1, 8, '480', 'ivwxyz4', oils_i18n_gettext('68','See From Tracing -- General Subdivision','acsaf','name')),
+ (69, 1, 9, '481', 'ivwxyz4', oils_i18n_gettext('69','See From Tracing -- Geographic Subdivision','acsaf','name')),
+ (70, 1, 10, '482', 'ivwxyz4', oils_i18n_gettext('70','See From Tracing -- Chronological Subdivision','acsaf','name')),
+ (71, 1, 11, '485', 'ivwxyz4', oils_i18n_gettext('71','See From Tracing -- Form Subdivision','acsaf','name')),
+ (72, 1, 12, '448', 'aivwxyz4', oils_i18n_gettext('72','See From Tracing -- Chronological Term','acsaf','name'));
INSERT INTO authority.browse_axis (code,name,description,sorter) VALUES
('title','Title','Title axis','titlesort'),
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority_4xx_fields.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority_4xx_fields.sql
new file mode 100644
index 0000000..c6383f1
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority_4xx_fields.sql
@@ -0,0 +1,10 @@
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+UPDATE authority.control_set_authority_field
+ SET name = REGEXP_REPLACE(name, '^See Also', 'See From')
+ WHERE tag LIKE '4__' AND control_set = 1;
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/100.circ_matrix.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 24 ++++++++++----------
.../Pg/upgrade/0810.data.authority_4xx_fields.sql | 10 ++++++++
...l => 0811.function.copy_related_hold_stats.sql} | 21 +++++++++--------
5 files changed, 35 insertions(+), 24 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0810.data.authority_4xx_fields.sql
copy Open-ILS/src/sql/Pg/upgrade/{0067.schema.hold-copy-ratios.sql => 0811.function.copy_related_hold_stats.sql} (78%)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list