[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. f4e5f0f9f6ae0cddebad0cd903b0aa6b1361b52b
Evergreen Git
git at git.evergreen-ils.org
Thu Jun 27 11:16:38 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, rel_2_4 has been updated
via f4e5f0f9f6ae0cddebad0cd903b0aa6b1361b52b (commit)
from 988d0450d5d8efc80612500539a25e7d99909550 (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 f4e5f0f9f6ae0cddebad0cd903b0aa6b1361b52b
Author: Dan Scott <dscott at laurentian.ca>
Date: Thu Jun 27 09:46:55 2013 -0400
Avoid 0788 duplication from 2.3 failure
Recent installs of 2.3, or upgrades during 2.3, will have introduced
0788 already into the upgrade process -- meaning that the 2.3-2.4.0
script will rollback the entire transaction if it hits the duplicated
0788. Instead, move 0788 into its own transaction to increase the
chances that the 2.3-2.4.0 script will work for sites that stay up to
date or that recently installed Evergreen.
Signed-off-by: Dan Scott <dscott at laurentian.ca>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.3-2.4.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.3-2.4.0-upgrade-db.sql
index 6c172a9..6d92029 100644
--- a/Open-ILS/src/sql/Pg/version-upgrade/2.3-2.4.0-upgrade-db.sql
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.3-2.4.0-upgrade-db.sql
@@ -3367,41 +3367,6 @@ END;
$func$ LANGUAGE PLPGSQL;
-
-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')
-;
-
SELECT evergreen.upgrade_deps_block_check('0789', :eg_version);
SELECT evergreen.upgrade_deps_block_check('0790', :eg_version);
@@ -3986,6 +3951,47 @@ WHERE name = 'Traditional with Holds-go-home' AND
COMMIT;
+\qecho 'These are from 0788, and should be run in their own transaction'
+\qecho 'If these fail due to 0788 already having been applied during'
+\qecho '2.3 upgrades, that is good; you have just saved yourself a lot of time.'
+\qecho
+
+BEGIN;
+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;
+
-- These are from 0789, and can and should be run outside of a transaction
CREATE TEXT SEARCH CONFIGURATION title ( COPY = english_nostop );
CREATE TEXT SEARCH CONFIGURATION author ( COPY = english_nostop );
-----------------------------------------------------------------------
Summary of changes:
.../Pg/version-upgrade/2.3-2.4.0-upgrade-db.sql | 76 +++++++++++---------
1 files changed, 41 insertions(+), 35 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list