[open-ils-commits] r9957 - branches/rel_1_2_2/Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 1 22:20:21 EDT 2008
Author: miker
Date: 2008-07-01 22:20:20 -0400 (Tue, 01 Jul 2008)
New Revision: 9957
Modified:
branches/rel_1_2_2/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql
Log:
update the currently indexed data to handle birth/death date stemming consistently
Modified: branches/rel_1_2_2/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql
===================================================================
--- branches/rel_1_2_2/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql 2008-07-02 02:19:37 UTC (rev 9956)
+++ branches/rel_1_2_2/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql 2008-07-02 02:20:20 UTC (rev 9957)
@@ -18,7 +18,7 @@
CREATE SCHEMA extend_reporter;
-CREATE TABLE extend_reporter.legcay_circ_count (
+CREATE TABLE extend_reporter.legacy_circ_count (
id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id)
circ_count INT NOT NULL DEFAULT 0
);
@@ -26,9 +26,33 @@
CREATE VIEW extend_reporter.full_circ_count AS
SELECT cp.id, COALESCE(sum(c.circ_count), 0::bigint) + COALESCE(count(circ.id), 0::bigint) AS circ_count
FROM asset."copy" cp
- LEFT JOIN extend_reporter.legcay_circ_count c USING (id)
+ LEFT JOIN extend_reporter.legacy_circ_count c USING (id)
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;
More information about the open-ils-commits
mailing list