Skip to content

Commit

Permalink
add indexes to user model
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Kaufeld committed Jun 8, 2021
1 parent 9ebdd8d commit a1a22a6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions authentication/migrations/0003_auto_20210608_1743.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.3 on 2021-06-08 17:43

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("authentication", "0002_auto_20201111_2224"),
]

operations = [
migrations.AlterModelOptions(name="blossomuser", options={},),
migrations.AddIndex(
model_name="blossomuser",
index=models.Index(
fields=["username", "email"], name="authenticat_usernam_22da7a_idx"
),
),
]
3 changes: 3 additions & 0 deletions authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class BlossomUser(AbstractUser):
status of the user and the roles they fulfill.
"""

class Meta:
indexes = [models.Index(fields=["username", "email"])]

# The backend class which is used to authenticate the BlossomUser.
backend = "authentication.backends.EmailBackend"

Expand Down

0 comments on commit a1a22a6

Please sign in to comment.