]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0877.data.re-add_800_t_search_and_facets.sql
LP#1117808: Stamping upgrade scripts for extend use of merge profiles
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0877.data.re-add_800_t_search_and_facets.sql
1 BEGIN;
2
3 SELECT evergreen.upgrade_deps_block_check('0877', :eg_version);
4
5 -- Don't use Series search field as the browse field
6 UPDATE config.metabib_field SET
7         browse_field = FALSE,
8         browse_xpath = NULL,
9         browse_sort_xpath = NULL,
10         xpath = $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo[not(@type="nfi")]$$
11 WHERE id = 1;
12
13 -- Create a new series browse config
14 INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, search_field, authority_xpath, browse_field, browse_sort_xpath ) VALUES
15     (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"]$$ );
16
17 COMMIT;
18
19 \qecho This is a full field-entry reingest of your bib records.
20 \qecho It will take a while.
21 \qecho You may cancel now without losing the effect of the rest of the
22 \qecho upgrade script, and arrange the reingest later.
23 \qecho .
24 SELECT COUNT(metabib.reingest_metabib_field_entries(id))
25     FROM biblio.record_entry WHERE deleted IS FALSE;