[open-ils-commits] r16453 - in trunk/Open-ILS/src/sql/Pg: . upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed May 19 15:24:53 EDT 2010
Author: miker
Date: 2010-05-19 15:24:48 -0400 (Wed, 19 May 2010)
New Revision: 16453
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0268.schema.identifier-cleanup.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
Log:
make the first_word index normalizer return a not-null value when given an empty string; remove naco and date normalizers from all identifier fields
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-19 18:54:25 UTC (rev 16452)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-19 19:24:48 UTC (rev 16453)
@@ -65,7 +65,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0267'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0268'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql 2010-05-19 18:54:25 UTC (rev 16452)
+++ trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql 2010-05-19 19:24:48 UTC (rev 16453)
@@ -85,7 +85,7 @@
$func$ LANGUAGE 'sql' STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION public.first_word ( TEXT ) RETURNS TEXT AS $$
- SELECT SUBSTRING( $1 FROM $_$^\S+$_$);
+ SELECT COALESCE(SUBSTRING( $1 FROM $_$^\S+$_$), '');
$$ LANGUAGE SQL STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION public.naco_normalize_keep_comma( TEXT ) RETURNS TEXT AS $func$
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0268.schema.identifier-cleanup.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0268.schema.identifier-cleanup.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0268.schema.identifier-cleanup.sql 2010-05-19 19:24:48 UTC (rev 16453)
@@ -0,0 +1,12 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0268'); -- miker
+
+CREATE OR REPLACE FUNCTION public.first_word ( TEXT ) RETURNS TEXT AS $$
+ SELECT COALESCE(SUBSTRING( $1 FROM $_$^\S+$_$), '');
+$$ LANGUAGE SQL STRICT IMMUTABLE;
+
+DELETE FROM config.metabib_field_index_norm_map WHERE norm IN (1,2) and field > 16;
+
+COMMIT;
+
More information about the open-ils-commits
mailing list