adding database update missed in previous commit
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Oct 2010 14:45:13 +0000 (14:45 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Oct 2010 14:45:13 +0000 (14:45 +0000)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18435 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql [new file with mode: 0644]

diff --git a/Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql b/Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql
new file mode 100644 (file)
index 0000000..03d3acb
--- /dev/null
@@ -0,0 +1,13 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0444'); -- gmc
+
+CREATE OR REPLACE FUNCTION oils_text_as_bytea (TEXT) RETURNS BYTEA AS $_$
+    SELECT CAST(REGEXP_REPLACE(UPPER($1), $$\\$$, $$\\\\$$, 'g') AS BYTEA);
+$_$ LANGUAGE SQL IMMUTABLE;
+
+DROP INDEX asset.asset_call_number_upper_label_id_owning_lib_idx;
+CREATE INDEX asset_call_number_upper_label_id_owning_lib_idx ON asset.call_number (oils_text_as_bytea(label),id,owning_lib);
+
+COMMIT;
+