[open-ils-commits] [GIT] Evergreen ILS branch master updated. 32862c51adbbddbb30cf2d9a2253f21b9b94b438

Evergreen Git git at git.evergreen-ils.org
Thu May 16 16:17:42 EDT 2013


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  32862c51adbbddbb30cf2d9a2253f21b9b94b438 (commit)
      from  02f1c1f1c5c31159bb7c8df147c4ff5588fdca76 (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 32862c51adbbddbb30cf2d9a2253f21b9b94b438
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu May 16 15:52:38 2013 -0400

    2.3.6 -> 2.3.7 DB upgrade script
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.3.6-2.3.7-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.3.6-2.3.7-upgrade-db.sql
new file mode 100644
index 0000000..28bf112
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.3.6-2.3.7-upgrade-db.sql
@@ -0,0 +1,40 @@
+--Upgrade Script for 2.3.6 to 2.3.7
+\set eg_version '''2.3.7'''
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.3.7', :eg_version);
+
+SELECT evergreen.upgrade_deps_block_check('0788', :eg_version);
+
+-- New view including 264 as a potential tag for publisher and pubdate
+CREATE OR REPLACE VIEW reporter.old_super_simple_record AS
+SELECT  r.id,
+    r.fingerprint,
+    r.quality,
+    r.tcn_source,
+    r.tcn_value,
+    FIRST(title.value) AS title,
+    FIRST(author.value) AS author,
+    ARRAY_TO_STRING(ARRAY_ACCUM( DISTINCT publisher.value), ', ') AS publisher,
+    ARRAY_TO_STRING(ARRAY_ACCUM( DISTINCT SUBSTRING(pubdate.value FROM $$\d+$$) ), ', ') AS pubdate,
+    ARRAY_ACCUM( DISTINCT REPLACE(SUBSTRING(isbn.value FROM $$^\S+$$), '-', '') ) AS isbn,
+    ARRAY_ACCUM( DISTINCT REGEXP_REPLACE(issn.value, E'^\\S*(\\d{4})[-\\s](\\d{3,4}x?)', E'\\1 \\2') ) AS issn
+  FROM  biblio.record_entry r
+    LEFT JOIN metabib.full_rec title ON (r.id = title.record AND title.tag = '245' AND title.subfield = 'a')
+    LEFT JOIN metabib.full_rec author ON (r.id = author.record AND author.tag IN ('100','110','111') AND author.subfield = 'a')
+    LEFT JOIN metabib.full_rec publisher ON (r.id = publisher.record AND (publisher.tag = '260' OR (publisher.tag = '264' AND publisher.ind2 = '1')) AND publisher.subfield = 'b')
+    LEFT JOIN metabib.full_rec pubdate ON (r.id = pubdate.record AND (pubdate.tag = '260' OR (pubdate.tag = '264' AND pubdate.ind2 = '1')) AND pubdate.subfield = 'c')
+    LEFT JOIN metabib.full_rec isbn ON (r.id = isbn.record AND isbn.tag IN ('024', '020') AND isbn.subfield IN ('a','z'))
+    LEFT JOIN metabib.full_rec issn ON (r.id = issn.record AND issn.tag = '022' AND issn.subfield = 'a')
+  GROUP BY 1,2,3,4,5;
+
+-- Update reporter.materialized_simple_record with new 264-based values for publisher and pubdate
+DELETE FROM reporter.materialized_simple_record WHERE id IN (
+    SELECT DISTINCT record FROM metabib.full_rec WHERE tag = '264' AND subfield IN ('b', 'c')
+);
+
+INSERT INTO reporter.materialized_simple_record
+    SELECT DISTINCT rossr.* FROM reporter.old_super_simple_record rossr INNER JOIN metabib.full_rec mfr ON mfr.record = rossr.id
+        WHERE mfr.tag = '264' AND mfr.subfield IN ('b', 'c')
+;
+
+COMMIT;

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

Summary of changes:
 .../2.3.6-2.3.7-upgrade-db.sql}                    |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
 copy Open-ILS/src/sql/Pg/{upgrade/0788.schema.reporter_264_pubinfo.sql => version-upgrade/2.3.6-2.3.7-upgrade-db.sql} (93%)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list