diff --git a/apps/member/models.py b/apps/member/models.py index 50b0bea1..b596357f 100644 --- a/apps/member/models.py +++ b/apps/member/models.py @@ -46,6 +46,7 @@ class Profile(models.Model): class Meta: verbose_name = _('user profile') verbose_name_plural = _('user profile') + indexes = [ models.Index(fields=['user']) ] def get_absolute_url(self): return reverse('user_detail', args=(self.pk,)) diff --git a/apps/note/models/notes.py b/apps/note/models/notes.py index 74cda3ea..70810ad8 100644 --- a/apps/note/models/notes.py +++ b/apps/note/models/notes.py @@ -209,6 +209,10 @@ class Alias(models.Model): class Meta: verbose_name = _("alias") verbose_name_plural = _("aliases") + indexes = [ + models.Index(fields=['name']), + models.Index(fields=['normalized_name']), + ] def __str__(self): return self.name diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py index 3bb7ca76..809e7c44 100644 --- a/apps/note/models/transactions.py +++ b/apps/note/models/transactions.py @@ -119,6 +119,11 @@ class Transaction(PolymorphicModel): class Meta: verbose_name = _("transaction") verbose_name_plural = _("transactions") + indexes = [ + models.Index(fields=['created_at']), + models.Index(fields=['source']), + models.Index(fields=['destination']), + ] def save(self, *args, **kwargs): """