From 01bd4aa7584dfdb5ed46f3aef39a50c6fcd207a7 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 16 Jan 2021 14:18:12 +0100 Subject: [PATCH 1/4] custom_user: index User.username and User.email (#49957) --- .../custom_user/migrations/0022_index_email.py | 14 ++++++++++++++ .../custom_user/migrations/0023_index_username.py | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/authentic2/custom_user/migrations/0022_index_email.py create mode 100644 src/authentic2/custom_user/migrations/0023_index_username.py diff --git a/src/authentic2/custom_user/migrations/0022_index_email.py b/src/authentic2/custom_user/migrations/0022_index_email.py new file mode 100644 index 00000000..55308e1e --- /dev/null +++ b/src/authentic2/custom_user/migrations/0022_index_email.py @@ -0,0 +1,14 @@ +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ('custom_user', '0021_set_unusable_password'), + ] + + operations = [ + migrations.RunSQL( + sql=r'CREATE INDEX "custom_user_user_email_idx" ON "custom_user_user" (UPPER("email") text_pattern_ops);', + reverse_sql=r'DROP INDEX "custom_user_user_email_idx";' + ), + ] diff --git a/src/authentic2/custom_user/migrations/0023_index_username.py b/src/authentic2/custom_user/migrations/0023_index_username.py new file mode 100644 index 00000000..97f8db7f --- /dev/null +++ b/src/authentic2/custom_user/migrations/0023_index_username.py @@ -0,0 +1,14 @@ +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ('custom_user', '0022_index_email'), + ] + + operations = [ + migrations.RunSQL( + sql=r'CREATE INDEX "custom_user_user_username_idx" ON "custom_user_user" (UPPER("username") text_pattern_ops);', + reverse_sql=r'DROP INDEX "custom_user_user_username_idx";' + ), + ] -- 2.29.2