update the currently indexed data to handle birth/death date stemming consistently
[Evergreen.git] / Open-ILS / src / sql / Pg / 1.2.2.1-1.2.2.2-upgrade-db.sql
index eb47a00..fc410a8 100644 (file)
@@ -30,5 +30,29 @@ CREATE VIEW extend_reporter.full_circ_count AS
    LEFT JOIN "action".circulation circ ON circ.target_copy = c.id
   GROUP BY cp.id;
 
+UPDATE  metabib.title_field_entry
+  SET   value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g')
+  WHERE value ~ E'(\\d{4})-(\\d{4})';
+
+UPDATE  metabib.author_field_entry
+  SET   value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g')
+  WHERE value ~ E'(\\d{4})-(\\d{4})';
+
+UPDATE  metabib.keyword_field_entry
+  SET   value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g')
+  WHERE value ~ E'(\\d{4})-(\\d{4})';
+
+UPDATE  metabib.subject_field_entry
+  SET   value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g')
+  WHERE value ~ E'(\\d{4})-(\\d{4})';
+
+UPDATE  metabib.series_field_entry
+  SET   value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g')
+  WHERE value ~ E'(\\d{4})-(\\d{4})';
+
+UPDATE  metabib.full_rec
+  SET   value = REGEXP_REPLACE(value, E'(\\d{4})-(\\d{4})', E'\\1 \\2','g')
+  WHERE value ~ E'(\\d{4})-(\\d{4})';
+
 COMMIT;