[open-ils-commits] [GIT] Evergreen ILS branch master updated. 54d4887c7d232ed8af0924d8ed80dd28526ca6fb
Evergreen Git
git at git.evergreen-ils.org
Mon Mar 26 10:51:48 EDT 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 54d4887c7d232ed8af0924d8ed80dd28526ca6fb (commit)
via 5bdbc2ce4abeb506cb2daa65ce7b4b0c6ced109c (commit)
from 66a470a28d133da13a60de76a56008aa1252adec (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 54d4887c7d232ed8af0924d8ed80dd28526ca6fb
Author: Mike Rylander <mrylander at gmail.com>
Date: Mon Mar 26 10:57:52 2012 -0400
Stamping upgrade script for ISSN normalization fix
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 02d4aa8..cc06eee 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,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 ('0692', :eg_version); -- miker/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0693', :eg_version); -- denials/miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.do_not_despace_issns.sql b/Open-ILS/src/sql/Pg/upgrade/0693.schema.do_not_despace_issns.sql
similarity index 75%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.do_not_despace_issns.sql
rename to Open-ILS/src/sql/Pg/upgrade/0693.schema.do_not_despace_issns.sql
index b788a2d..50ce4b4 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.do_not_despace_issns.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0693.schema.do_not_despace_issns.sql
@@ -1,3 +1,14 @@
+-- Evergreen DB patch 0693.schema.do_not_despace_issns.sql
+--
+-- FIXME: insert description of change, if needed
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0693', :eg_version);
+
+-- FIXME: add/check SQL statements to perform the upgrade
-- Delete the index normalizer that was meant to remove spaces from ISSNs
-- but ended up breaking records with multiple ISSNs
DELETE FROM config.metabib_field_index_norm_map WHERE id IN (
@@ -19,3 +30,6 @@ SELECT metabib.reingest_metabib_field_entries(source)
AND cmf.name = 'issn'
AND char_length(value) > 9
;
+
+
+COMMIT;
commit 5bdbc2ce4abeb506cb2daa65ce7b4b0c6ced109c
Author: Dan Scott <dan at coffeecode.net>
Date: Wed Mar 21 22:39:40 2012 -0400
LP932540: Fix ISSN indexing
The default config.metabib_field_index_norm_map contains a 'replace'
entry for the ISSN identifier field that replaces spaces with "". That
was meant to handle ISSNs that incorrectly contain a space instead of a
hyphen; it normalizes them from: "1234 1234" to "12341234".
However, that breaks indexing ISSNs if there are multiple ISSNs in the
record, or even if there is an extra character in the same subfield as
the primary ISSN, as all spaces are removed.
This commit removes the 'replace' entry for the ISSN identifier field
and reindexes potentially damaged ISSN index entries.
Signed-off-by: Dan Scott <dan at coffeecode.net>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index aa98c2e..e17f0ee 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -7393,15 +7393,6 @@ INSERT INTO config.metabib_field_index_norm_map (field,norm,params)
WHERE i.func IN ('replace')
AND m.id IN (19);
-INSERT INTO config.metabib_field_index_norm_map (field,norm,params)
- SELECT m.id,
- i.id,
- $$[" ",""]$$
- FROM config.metabib_field m,
- config.index_normalizer i
- WHERE i.func IN ('replace')
- AND m.id IN (19);
-
INSERT INTO config.metabib_field_index_norm_map (field,norm,pos)
SELECT m.id,
i.id,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.do_not_despace_issns.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.do_not_despace_issns.sql
new file mode 100644
index 0000000..b788a2d
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.do_not_despace_issns.sql
@@ -0,0 +1,21 @@
+-- Delete the index normalizer that was meant to remove spaces from ISSNs
+-- but ended up breaking records with multiple ISSNs
+DELETE FROM config.metabib_field_index_norm_map WHERE id IN (
+ SELECT map.id FROM config.metabib_field_index_norm_map map
+ INNER JOIN config.metabib_field cmf ON cmf.id = map.field
+ INNER JOIN config.index_normalizer cin ON cin.id = map.norm
+ WHERE cin.func = 'replace'
+ AND cmf.field_class = 'identifier'
+ AND cmf.name = 'issn'
+ AND map.params = $$[" ",""]$$
+);
+
+-- Reindex records that have more than just a single ISSN
+-- to ensure that spaces are maintained
+SELECT metabib.reingest_metabib_field_entries(source)
+ FROM metabib.identifier_field_entry mife
+ INNER JOIN config.metabib_field cmf ON cmf.id = mife.field
+ WHERE cmf.field_class = 'identifier'
+ AND cmf.name = 'issn'
+ AND char_length(value) > 9
+;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 9 -----
.../upgrade/0693.schema.do_not_despace_issns.sql | 35 ++++++++++++++++++++
3 files changed, 36 insertions(+), 10 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0693.schema.do_not_despace_issns.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list