[open-ils-commits] [GIT] Evergreen ILS branch rel_2_12 updated. 2aaed8b1c5f0b4757f2e34724913f0e7a73fe951

Evergreen Git git at git.evergreen-ils.org
Wed Apr 19 13:05:50 EDT 2017


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_12 has been updated
       via  2aaed8b1c5f0b4757f2e34724913f0e7a73fe951 (commit)
       via  2524dee5e69ae63588edef107b4a5c627197332e (commit)
      from  d6b527aa5127a5534b7f9d88a752b1a3f9d2ef7b (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 2aaed8b1c5f0b4757f2e34724913f0e7a73fe951
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Wed Apr 19 13:00:10 2017 -0400

    LP#1680554: Stamping upgrade script for fix browse definition ids
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    
    Conflicts:
    	Open-ILS/src/sql/Pg/002.schema.config.sql

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 9770e54..bfeeb14 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 ('1031', :eg_version); -- jeffdavis/kmlussier
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1033', :eg_version); -- gmcharlt/kmlussier
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.fix_subject_browse_mappings.sql b/Open-ILS/src/sql/Pg/upgrade/1033.data.fix_subject_browse_mappings.sql
similarity index 97%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.fix_subject_browse_mappings.sql
rename to Open-ILS/src/sql/Pg/upgrade/1033.data.fix_subject_browse_mappings.sql
index d4f696e..19226bb 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.fix_subject_browse_mappings.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1033.data.fix_subject_browse_mappings.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1033', :eg_version);
 
 -- correctly turn off browsing for subjectd|geograhic and
 -- subject|temporal now that the *_browse versions exist. This is

commit 2524dee5e69ae63588edef107b4a5c627197332e
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Apr 19 12:17:44 2017 -0400

    LP#1680554: fix upgrade of subject|temporal_browse and subject|geographic_browse indexes
    
    This patch fixes an issue where an Evergreen database that was
    upgraded to 2.12.0 from an earlier version may not have had
    the browsability of the subject|temporal and subject|geographic
    indexes turned off in favor of the new *_browse versions. It also
    fixes mapping of the new *_browse indexes to authority control
    set bib fields.
    
    Note that if the database started at 2.12.0, the browse
    reingest can be cancelled.
    
    To test
    -------
    [1] On a database that was upgraded to 2.12.0 from an earlier
        version, verify that after applying the database update and
        performing the browse reingest, that there are no
        metabib.browse_entry_def_map rows where def is 11 or 13. Also
        Also verify that the query that runs as part of the update
    [2] On a database that was installed starting at 2.12.0, verify
        that the database update is a no-op.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.fix_subject_browse_mappings.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.fix_subject_browse_mappings.sql
new file mode 100644
index 0000000..d4f696e
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.fix_subject_browse_mappings.sql
@@ -0,0 +1,75 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+-- correctly turn off browsing for subjectd|geograhic and
+-- subject|temporal now that the *_browse versions exist. This is
+-- a no-op in a database that was started at version 2.12.0.
+UPDATE config.metabib_field
+SET browse_field = FALSE
+WHERE field_class = 'subject' AND name = 'geographic'
+AND browse_field
+AND id = 11;
+UPDATE config.metabib_field
+SET browse_field = FALSE
+WHERE field_class = 'subject' AND name = 'temporal'
+AND browse_field
+AND id = 13;
+
+select b.tag, idx.name
+from authority.control_set_bib_field b
+join authority.control_set_bib_field_metabib_field_map map on (b.id = map.bib_field)
+join config.metabib_field idx on (map.metabib_field = idx.id)
+order by b.tag;
+
+-- and fix bib field mapping if necessasry
+UPDATE authority.control_set_bib_field_metabib_field_map map
+SET metabib_field = cmf.id
+FROM config.metabib_field cmf
+WHERE cmf.field_class = 'subject' AND cmf.name= 'temporal_browse'
+AND   map.bib_field IN (
+    SELECT b.id
+    FROM authority.control_set_bib_field b
+    JOIN authority.control_set_authority_field a
+    ON (b.authority_field = a.id)
+    AND a.tag = '148'
+)
+AND   map.metabib_field IN (
+    SELECT id
+    FROM config.metabib_field
+    WHERE field_class = 'subject' AND name = 'geographic_browse'
+);
+UPDATE authority.control_set_bib_field_metabib_field_map map
+SET metabib_field = cmf.id
+FROM config.metabib_field cmf
+WHERE cmf.field_class = 'subject' AND cmf.name= 'geographic_browse'
+AND   map.bib_field IN (
+    SELECT b.id
+    FROM authority.control_set_bib_field b
+    JOIN authority.control_set_authority_field a
+    ON (b.authority_field = a.id)
+    AND a.tag = '151'
+)
+AND   map.metabib_field IN (
+    SELECT id
+    FROM config.metabib_field
+    WHERE field_class = 'subject' AND name = 'temporal_browse'
+);
+
+\qecho Verify that bib subject fields appear to be mapped to
+\qecho to correct browse indexes
+SELECT b.id, b.tag, idx.field_class, idx.name
+FROM authority.control_set_bib_field b
+JOIN authority.control_set_bib_field_metabib_field_map map ON (b.id = map.bib_field)
+JOIN config.metabib_field idx ON (map.metabib_field = idx.id)
+WHERE tag ~ '^6'
+ORDER BY b.tag;
+
+COMMIT;
+
+\qecho This is a browse-only reingest of your bib records. It may take a while.
+\qecho You may cancel now without losing the effect of the rest of the
+\qecho upgrade script, and arrange the reingest later.
+\qecho .
+SELECT metabib.reingest_metabib_field_entries(id, TRUE, FALSE, TRUE)
+    FROM biblio.record_entry;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 .../1033.data.fix_subject_browse_mappings.sql      |   75 ++++++++++++++++++++
 2 files changed, 76 insertions(+), 1 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/1033.data.fix_subject_browse_mappings.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list