summary refs log tree commit diff
path: root/synapse/storage/schema/delta
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/schema/delta')
-rw-r--r--synapse/storage/schema/delta/36/user_threepids.sql (renamed from synapse/storage/schema/delta/36/user_threepids_medium_address_index.sql)9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/storage/schema/delta/36/user_threepids_medium_address_index.sql b/synapse/storage/schema/delta/36/user_threepids.sql
index 702a872784..ef8813e72a 100644
--- a/synapse/storage/schema/delta/36/user_threepids_medium_address_index.sql
+++ b/synapse/storage/schema/delta/36/user_threepids.sql
@@ -13,4 +13,11 @@
  * limitations under the License.
  */
 
-CREATE INDEX user_threepids_medium_address on user_threepids (medium, LOWER(address));
+/*
+ * Update any email addresses that were stored with mixed case into all
+ * lowercase
+ */
+UPDATE user_threepids SET address = LOWER(address) where medium = 'email';
+
+/* Add an index for the select we do on passwored reset */
+CREATE INDEX user_threepids_medium_address on user_threepids (medium, address);