LP#1613341: Stamping upgrade script for punctuation-insensitive patron search
authorKathy Lussier <klussier@masslnc.org>
Thu, 9 Feb 2017 23:28:12 +0000 (18:28 -0500)
committerKathy Lussier <klussier@masslnc.org>
Thu, 9 Feb 2017 23:28:12 +0000 (18:28 -0500)
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1008.schema.patron_punct.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron_punct.sql [deleted file]

index a0c51b3..1c5b717 100644 (file)
@@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1007', :eg_version); -- gmcharlt/kmlussier
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1008', :eg_version); -- Dpearl/kmlussier
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1008.schema.patron_punct.sql b/Open-ILS/src/sql/Pg/upgrade/1008.schema.patron_punct.sql
new file mode 100644 (file)
index 0000000..c7d6633
--- /dev/null
@@ -0,0 +1,21 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1008', :eg_version);
+
+CREATE OR REPLACE FUNCTION evergreen.unaccent_and_squash ( IN arg text) RETURNS text
+    IMMUTABLE STRICT AS $$
+       BEGIN
+       RETURN evergreen.lowercase(unaccent(regexp_replace(arg, '[\s[:punct:]]','','g')));
+       END;
+$$ LANGUAGE PLPGSQL;
+
+-- Upon upgrade, we need to
+-- reindex because the definition of the unaccent_and_squash function
+-- has changed.
+REINDEX INDEX actor.actor_usr_first_given_name_unaccent_idx;
+REINDEX INDEX actor.actor_usr_second_given_name_unaccent_idx;
+REINDEX INDEX actor.actor_usr_family_name_unaccent_idx;
+
+COMMIT;
+
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron_punct.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron_punct.sql
deleted file mode 100644 (file)
index 3713a3b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('0986', :eg_version);
-
-CREATE OR REPLACE FUNCTION evergreen.unaccent_and_squash ( IN arg text) RETURNS text
-    IMMUTABLE STRICT AS $$
-       BEGIN
-       RETURN evergreen.lowercase(unaccent(regexp_replace(arg, '[\s[:punct:]]','','g')));
-       END;
-$$ LANGUAGE PLPGSQL;
-
--- Upon upgrade, we need to
--- reindex because the definition of the unaccent_and_squash function
--- has changed.
-REINDEX INDEX actor.actor_usr_first_given_name_unaccent_idx;
-REINDEX INDEX actor.actor_usr_second_given_name_unaccent_idx;
-REINDEX INDEX actor.actor_usr_family_name_unaccent_idx;
-
-COMMIT;
-
-