[open-ils-commits] r12708 - branches/rel_1_4_0/Open-ILS/src/sql/Pg (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 27 17:22:23 EDT 2009
Author: miker
Date: 2009-03-27 17:22:19 -0400 (Fri, 27 Mar 2009)
New Revision: 12708
Modified:
branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql
branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.4-1.4-upgrade-db.sql
Log:
next 1.2-1.4 upgrade will include removal of errant slashes from old ingest
Modified: branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql
===================================================================
--- branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql 2009-03-27 20:00:33 UTC (rev 12707)
+++ branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql 2009-03-27 21:22:19 UTC (rev 12708)
@@ -15,10 +15,36 @@
*/
-\set ON_ERROR_STOP 1
ALTER TABLE auditor.asset_copy_history ALTER COLUMN price DROP NOT NULL; -- Price is nullable in 1.4+, auditor triggers complain when it's not informed of this
+-- Get rid of embedded slashes from old ingest
+UPDATE metabib.title_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.author_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.subject_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.series_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.keyword_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.full_rec
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+\set ON_ERROR_STOP 1
+
BEGIN;
-- To avoid any updates while we're doin' our thing...
Modified: branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.4-1.4-upgrade-db.sql
===================================================================
--- branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.4-1.4-upgrade-db.sql 2009-03-27 20:00:33 UTC (rev 12707)
+++ branches/rel_1_4_0/Open-ILS/src/sql/Pg/1.2.4-1.4-upgrade-db.sql 2009-03-27 21:22:19 UTC (rev 12708)
@@ -15,10 +15,35 @@
*/
+ALTER TABLE auditor.asset_copy_history ALTER COLUMN price DROP NOT NULL; -- Price is nullable in 1.4+, auditor triggers complain when it's not informed of this
+
+-- Get rid of embedded slashes from old ingest
+UPDATE metabib.title_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.author_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.subject_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.series_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.keyword_field_entry
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
+UPDATE metabib.full_rec
+SET value = REGEXP_REPLACE(value, E'(\\w+)\\/(\\w+)', E'\\1 \\2','g')
+WHERE value ~ E'(\\w+)\\/(\\w+)';
+
\set ON_ERROR_STOP 1
-ALTER TABLE auditor.asset_copy_history ALTER COLUMN price DROP NOT NULL; -- Price is nullable in 1.4+, auditor triggers complain when it's not informed of this
-
BEGIN;
-- To avoid any updates while we're doin' our thing...
More information about the open-ils-commits
mailing list