From e0241ca79851fcc1c459f49f8d1899f54d83034c Mon Sep 17 00:00:00 2001 From: Lymar Volodymyr Date: Sat, 29 Jun 2024 12:21:04 +0200 Subject: [PATCH] perf: added index for email field in user model --- users/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/models.py b/users/models.py index 71fba04..8a09758 100644 --- a/users/models.py +++ b/users/models.py @@ -60,7 +60,7 @@ def create_superuser(self, email, full_name, password=None, **extra_fields): # Информация о пользователе приложения class CustomUser(AbstractBaseUser, PermissionsMixin): - email = models.EmailField(max_length=50, unique=True, verbose_name="E-mail") + email = models.EmailField(max_length=50, unique=True, db_index=True, verbose_name="E-mail") full_name = models.CharField(max_length=75, verbose_name="ФИО") position = models.ForeignKey( Position,