From 54d4887c7d232ed8af0924d8ed80dd28526ca6fb Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 26 Mar 2012 10:57:52 -0400 Subject: [PATCH] Stamping upgrade script for ISSN normalization fix Signed-off-by: Mike Rylander --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- ...pace_issns.sql => 0693.schema.do_not_despace_issns.sql} | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) rename Open-ILS/src/sql/Pg/upgrade/{XXXX.schema.do_not_despace_issns.sql => 0693.schema.do_not_despace_issns.sql} (75%) diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 02d4aa8934..cc06eee875 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 b788a2d488..50ce4b46c3 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; -- 2.11.0