Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bestpractical/rt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorsunnavy <sunnavy@bestpractical.com>2020-01-25 00:50:08 +0300
committerBrian Conry <bconry@bestpractical.com>2022-01-28 17:24:08 +0300
commit6ab60906c431f63d845e5f0fbc5825ef30981c98 (patch)
treef465fb94530cf054bcf71feae2b0edb209128442 /etc
parent9dfb60f5395fcf7f272cab898d3d923d139f44d8 (diff)
Update EmailAddress index to case insensitive for Pg
EmailAddress is case insensitive in RT(technically, name part could be sensitive according to RFC, but it's confusing and rarely used in real world). When we call RT::User::LoadByEmail, the WHERE part of generated SQL in Pg is actually like: LOWER(EmailAddress) = LOWER(?) Thus we need to adjust index accordingly, which is also consistent with the one in Oracle.
Diffstat (limited to 'etc')
-rw-r--r--etc/schema.Pg2
-rw-r--r--etc/upgrade/4.4.6/schema.Pg2
2 files changed, 3 insertions, 1 deletions
diff --git a/etc/schema.Pg b/etc/schema.Pg
index aa4b437e0a..0c31de6c68 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -383,7 +383,7 @@ CREATE TABLE Users (
CREATE UNIQUE INDEX Users1 ON Users (LOWER(Name)) ;
-CREATE INDEX Users4 ON Users (EmailAddress);
+CREATE INDEX Users4 ON Users (LOWER(EmailAddress));
diff --git a/etc/upgrade/4.4.6/schema.Pg b/etc/upgrade/4.4.6/schema.Pg
new file mode 100644
index 0000000000..628b446a75
--- /dev/null
+++ b/etc/upgrade/4.4.6/schema.Pg
@@ -0,0 +1,2 @@
+DROP INDEX Users4;
+CREATE INDEX Users4 ON Users (LOWER(EmailAddress));