[open-ils-commits] [GIT] Evergreen ILS branch master updated. 5abb6776fbf7a7700f1d54a9405c2af915ac2404
Evergreen Git
git at git.evergreen-ils.org
Fri Nov 17 15:15:35 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 5abb6776fbf7a7700f1d54a9405c2af915ac2404 (commit)
via b95949a1489e1d761b9b11bfa7c3fb4e9d6e386a (commit)
from 2ea48c6e65c8619888f13805a8e32912c14762c1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5abb6776fbf7a7700f1d54a9405c2af915ac2404
Author: Jason Stephenson <jason at sigio.com>
Date: Fri Nov 17 15:15:15 2017 -0500
LP#1671150 Stamp database upgrade script.
Signed-off-by: Jason Stephenson <jason at sigio.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index d821d84..efac8d3 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,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 ('1082', :eg_version); -- jboyer/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1083', :eg_version); -- jeff/dyrcona
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.qualify_unaccent_refs.sql b/Open-ILS/src/sql/Pg/upgrade/1083.scema.qualify_unaccent_refs.sql
similarity index 92%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.qualify_unaccent_refs.sql
rename to Open-ILS/src/sql/Pg/upgrade/1083.scema.qualify_unaccent_refs.sql
index 5a73f4b..46a7c08 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.qualify_unaccent_refs.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1083.scema.qualify_unaccent_refs.sql
@@ -6,8 +6,7 @@ BEGIN;
-- check whether patch can be applied
--- FIXME: uncomment when we have an upgrade number
--- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1083', :eg_version);
CREATE OR REPLACE FUNCTION evergreen.unaccent_and_squash ( IN arg text) RETURNS text
IMMUTABLE STRICT AS $$
commit b95949a1489e1d761b9b11bfa7c3fb4e9d6e386a
Author: Jeff Godin <jgodin at tadl.org>
Date: Thu Jun 22 20:03:29 2017 -0400
LP#1671150 fix unqualified unaccent call
Fix index creation failures when using pg_restore by qualifying the
unaccent() function call in evergreen.unaccent_and_squash()
Signed-off-by: Jeff Godin <jgodin at tadl.org>
Signed-off-by: Jason Stephenson <jason at sigio.com>
diff --git a/Open-ILS/src/sql/Pg/000.functions.general.sql b/Open-ILS/src/sql/Pg/000.functions.general.sql
index 8b0dd63..e0aae8d 100644
--- a/Open-ILS/src/sql/Pg/000.functions.general.sql
+++ b/Open-ILS/src/sql/Pg/000.functions.general.sql
@@ -89,7 +89,7 @@ LANGUAGE plpgsql;
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')));
+ RETURN evergreen.lowercase(public.unaccent('public.unaccent', regexp_replace(arg, '[\s[:punct:]]','','g')));
END;
$$ LANGUAGE PLPGSQL;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.qualify_unaccent_refs.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.qualify_unaccent_refs.sql
new file mode 100644
index 0000000..5a73f4b
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.qualify_unaccent_refs.sql
@@ -0,0 +1,32 @@
+-- Evergreen DB patch XXXX.schema.qualify_unaccent_refs.sql
+--
+-- LP#1671150 Fix unaccent() function call in evergreen.unaccent_and_squash()
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+-- FIXME: uncomment when we have an upgrade number
+-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION evergreen.unaccent_and_squash ( IN arg text) RETURNS text
+ IMMUTABLE STRICT AS $$
+ BEGIN
+ RETURN evergreen.lowercase(public.unaccent('public.unaccent', regexp_replace(arg, '[\s[:punct:]]','','g')));
+ END;
+$$ LANGUAGE PLPGSQL;
+
+-- Drop indexes if present, so that we can re-create them
+DROP INDEX IF EXISTS actor.actor_usr_first_given_name_unaccent_idx;
+DROP INDEX IF EXISTS actor.actor_usr_second_given_name_unaccent_idx;
+DROP INDEX IF EXISTS actor.actor_usr_family_name_unaccent_idx;
+DROP INDEX IF EXISTS actor.actor_usr_usrname_unaccent_idx;
+
+-- Create (or re-create) indexes -- they may be missing if pg_restore failed to create
+-- them due to the previously unqualified call to unaccent()
+CREATE INDEX actor_usr_first_given_name_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(first_given_name));
+CREATE INDEX actor_usr_second_given_name_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(second_given_name));
+CREATE INDEX actor_usr_family_name_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(family_name));
+CREATE INDEX actor_usr_usrname_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(usrname));
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/000.functions.general.sql | 2 +-
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
.../upgrade/1083.scema.qualify_unaccent_refs.sql | 31 ++++++++++++++++++++
3 files changed, 33 insertions(+), 2 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/1083.scema.qualify_unaccent_refs.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list