Schema Changes: 2.5.4

Upgrade: 2.5.3 → 2.5.4

This release applied 2 migration(s) to the database schema.

ID Type Description

869

schema

pre calculate prox adjustment

877

data

re add 800 t search and facets

Migration Details

869 — pre calculate prox adjustment

Type: schema

View SQL
CREATE OR REPLACE FUNCTION action.hold_copy_calculated_proximity_update () RETURNS TRIGGER AS $f$
    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;

877 — re add 800 t search and facets

Type: data

View SQL
-- 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"]$$ );


SELECT COUNT(metabib.reingest_metabib_field_entries(id))
    FROM biblio.record_entry WHERE deleted IS FALSE;