LP#1798910: Update bib visibility whenever necessary user/miker/lp-1798910-update_bib_vis_on_same_marc
authorMike Rylander <mrylander@gmail.com>
Thu, 7 Nov 2019 16:05:00 +0000 (11:05 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 7 Nov 2019 16:16:32 +0000 (11:16 -0500)
commit3929fb367a7829a5de2e81e5312e72fcda1a200c
tree5fa83817c22c312558be8ee28a29bedc727de167
parente0d52892b1aa320c7b4ff2c276b334dce59cc86c
LP#1798910: Update bib visibility whenever necessary

Before this commit, we avoid a trigger loop related to updating a bib
record's visibility attributes in the heavy-handed way of refusing to do
so if the 'ingest.reingest.force_on_same_marc' flag is enabled.
However, this keeps us from seeing Located URI changes.

This commit, inspired by Josh Stompro, checks to see if the bib's
visibility attributes have actually changed due to a located URI change,
and only updates the row in that case.  It also forces a stable order
for LURI-based visibility to avoid any possible flapping due to returned
row order when LURIs are updated or regenerated.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/300.schema.staged_search.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.function.cache_bib_vis_attrs.sql [new file with mode: 0644]