Skip to content

Commit

Permalink
⚡️ Add db index in FoiMessage.email_message_id
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Dec 20, 2022
1 parent b30d5ef commit efebd96
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.0.8 on 2022-12-19 13:40

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("foirequest", "0060_foirequest_banner"),
]

operations = [
migrations.AddIndex(
model_name="foimessage",
index=models.Index(
fields=["email_message_id"], name="foirequest__email_m_304d80_idx"
),
),
]
2 changes: 2 additions & 0 deletions froide/foirequest/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class Meta:
verbose_name = _("Freedom of Information Message")
verbose_name_plural = _("Freedom of Information Messages")

indexes = [models.Index(fields=["email_message_id"])]

def __str__(self):
return _("Message in '%(request)s' at %(time)s") % {
"request": self.request,
Expand Down

0 comments on commit efebd96

Please sign in to comment.