[open-ils-commits] [GIT] Evergreen ILS branch rel_2_5 updated. 9407725acf1d1d082520762b4797af8aa9ac93c3
Evergreen Git
git at git.evergreen-ils.org
Thu May 29 09:20:59 EDT 2014
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_5 has been updated
via 9407725acf1d1d082520762b4797af8aa9ac93c3 (commit)
from 5dda3727fdddc7364be3afb09934700df227e4f9 (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 9407725acf1d1d082520762b4797af8aa9ac93c3
Author: Dan Wells <dbw2 at calvin.edu>
Date: Thu May 29 09:15:01 2014 -0400
Forward port 2.5.4 upgrade script
Signed-off-by: Dan Wells <dbw2 at calvin.edu>
diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.5.3-2.5.4-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.5.3-2.5.4-upgrade-db.sql
new file mode 100644
index 0000000..e87c8c8
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.5.3-2.5.4-upgrade-db.sql
@@ -0,0 +1,79 @@
+--Upgrade Script for 2.5.3 to 2.5.4
+\set eg_version '''2.5.4'''
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.5.4', :eg_version);
+
+SELECT evergreen.upgrade_deps_block_check('0869', :eg_version);
+
+CREATE OR REPLACE FUNCTION action.hold_copy_calculated_proximity_update () RETURNS TRIGGER AS $f$
+BEGIN
+ NEW.proximity := action.hold_copy_calculated_proximity(NEW.hold,NEW.target_copy);
+ RETURN NEW;
+END;
+$f$ LANGUAGE PLPGSQL;
+
+CREATE TRIGGER hold_copy_proximity_update_tgr BEFORE INSERT OR UPDATE ON action.hold_copy_map FOR EACH ROW EXECUTE PROCEDURE action.hold_copy_calculated_proximity_update ();
+
+-- Now, cause the update we need in a HOT-friendly manner (http://pgsql.tapoueh.org/site/html/misc/hot.html)
+UPDATE action.hold_copy_map SET proximity = proximity WHERE proximity IS NULL;
+
+
+
+SELECT evergreen.upgrade_deps_block_check('0877', :eg_version);
+
+-- Don't use Series search field as the browse field
+UPDATE config.metabib_field SET
+ browse_field = FALSE,
+ browse_xpath = NULL,
+ browse_sort_xpath = NULL,
+ xpath = $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo[not(@type="nfi")]$$
+WHERE id = 1;
+
+-- Create a new series browse config
+INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, search_field, authority_xpath, browse_field, browse_sort_xpath ) VALUES
+ (32, 'series', 'browse', oils_i18n_gettext(32, 'Series Title (Browse)', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo[@type="nfi"]$$, FALSE, '//@xlink:href', TRUE, $$*[local-name() != "nonSort"]$$ );
+
+
+\qecho ---------------------------------------------------------------
+\qecho We will now do a "quick fix" indexing of series titles for search.
+\qecho .
+\qecho Ultimately, a full field-entry reingest of your affected series bib
+\qecho records should be done. It might take a while.
+\qecho Something like this should suffice:
+\qecho ---------------------------------------------------------------
+\qecho 'SELECT COUNT(metabib.reingest_metabib_field_entries(id))'
+\qecho ' FROM ('
+\qecho ' SELECT DISTINCT(bre.id) AS id'
+\qecho ' FROM biblio.record_entry bre'
+\qecho ' JOIN metabib.full_rec mfr'
+\qecho ' ON mfr.record = bre.id'
+\qecho ' AND mfr.tag IN (\'490\', \'800\', \'810\', \'811\', \'830\')'
+\qecho ' WHERE'
+\qecho ' bre.deleted IS FALSE'
+\qecho ' AND ('
+\qecho ' mfr.tag = \'490\' AND mfr.subfield = \'a\''
+\qecho ' OR mfr.tag IN (\'800\',\'810\',\'811\') AND mfr.subfield = \'t\''
+\qecho ' OR mfr.tag = \'830\' AND mfr.subfield IN (\'a\',\'t\')'
+\qecho ' )'
+\qecho ' ) x'
+\qecho ';'
+\qecho ---------------------------------------------------------------
+
+-- "Quick Fix" indexing of series for search
+INSERT INTO metabib.series_field_entry (field,source,value)
+ SELECT 1,record,value FROM metabib.full_rec WHERE tag = '490' AND subfield = 'a';
+
+INSERT INTO metabib.series_field_entry (field,source,value)
+ SELECT 1,record,value FROM metabib.full_rec WHERE tag IN ('800','810','811') AND subfield = 't';
+
+INSERT INTO metabib.series_field_entry (field,source,value)
+ SELECT 1,record,value FROM metabib.full_rec WHERE tag = '830' AND subfield IN ('a','t');
+
+DELETE FROM metabib.combined_series_field_entry;
+INSERT INTO metabib.combined_series_field_entry(record, metabib_field, index_vector)
+ SELECT source, field, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+ FROM metabib.series_field_entry GROUP BY source, field;
+INSERT INTO metabib.combined_series_field_entry(record, index_vector)
+ SELECT source, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+ FROM metabib.series_field_entry GROUP BY source;
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
.../2.5.3-2.5.4-upgrade-db.sql} | 21 +++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
copy Open-ILS/src/sql/Pg/{upgrade/0877.data.re-add_800_t_search_and_facets.sql => version-upgrade/2.5.3-2.5.4-upgrade-db.sql} (78%)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list