[open-ils-commits] [GIT] Evergreen ILS branch master updated. 77ac8a925ba59552b1bab9b85e2fa63275eebca3

Evergreen Git git at git.evergreen-ils.org
Sun Nov 18 12:46:43 EST 2012


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, master has been updated
       via  77ac8a925ba59552b1bab9b85e2fa63275eebca3 (commit)
      from  4c9c98e689f86a5f3b254fb33803f608e32a14c4 (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 77ac8a925ba59552b1bab9b85e2fa63275eebca3
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Sep 26 23:34:32 2012 -0400

    After upgrade, list records with missing or incorrect 901$c
    
    This is a common cause of pain for upgrades. Let's try to identify the
    problem early (even if it takes forever on a site with 3 million bibs)
    and offer advice on correcting the problem if it is flagged.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql
index cc9b4b1..bd7b2b9 100644
--- a/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql
@@ -16198,3 +16198,22 @@ CREATE INDEX ii_poi_idx on acq.invoice_item (po_item);
 
 DROP LANGUAGE plperl;
 
+\qecho Evergreen depends heavily on each bibliographic record containing
+\qecho a 901 field with a subfield "c" to hold the record ID. The following
+\qecho query identifies the bibs that are missing 901s or whose first
+\qecho 901$c is not equal to the bib ID. This *will* take a long time in a
+\qecho big database; as the schema updates are over now, you can cancel this
+\qecho if you are in a rush.
+
+SELECT id
+  FROM biblio.record_entry
+  WHERE (
+    (XPATH('//marc:datafield[@tag="901"][1]/marc:subfield[@code="c"]/text()', marc::XML, ARRAY[ARRAY['marc', 'http://www.loc.gov/MARC21/slim']]))[1]::TEXT IS NULL
+  OR
+    (XPATH('//marc:datafield[@tag="901"][1]/marc:subfield[@code="c"]/text()', marc::XML, ARRAY[ARRAY['marc', 'http://www.loc.gov/MARC21/slim']]))[1]::TEXT <> id::TEXT)
+  AND id > -1;
+
+\qecho If there are records with missing or incorrect 901$c values, you can
+\qecho generally rely on the triggers in the biblio.record_entry table to
+\qecho populate the 901$c properly; for each offending record, run:
+\qecho   UPDATE biblio.record_entry SET marc = marc WHERE id = <id>;

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

Summary of changes:
 .../sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql  |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list