Files
zulip/zerver/migrations/0006_zerver_userprofile_email_upper_idx.py
Tim Abbott ebcb569c96 Add case-insensitive index on UserProfile.email.
This fixes a performance issue looking up UserProfile objects for
realms with a large number of users in the case that a UserProfile
object is not in the cache.

Thanks to @dbiollo for the suggestion!
2016-01-09 20:01:37 -08:00

17 lines
440 B
Python

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0005_auto_20150920_1340'),
]
operations = [
migrations.RunSQL("CREATE INDEX upper_userprofile_email_idx ON zerver_userprofile ((upper(email)));",
reverse_sql="DROP INDEX upper_userprofile_email_idx;"),
]