From efebd9644e1dbd52be826c9bdcb33e658f59aae6 Mon Sep 17 00:00:00 2001 From: Karl Engelhardt Date: Mon, 19 Dec 2022 14:41:02 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Add=20db=20index=20in=20Fo?= =?UTF-8?q?iMessage.email=5Fmessage=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...imessage_foirequest__email_m_304d80_idx.py | 19 +++++++++++++++++++ froide/foirequest/models/message.py | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 froide/foirequest/migrations/0061_foimessage_foirequest__email_m_304d80_idx.py diff --git a/froide/foirequest/migrations/0061_foimessage_foirequest__email_m_304d80_idx.py b/froide/foirequest/migrations/0061_foimessage_foirequest__email_m_304d80_idx.py new file mode 100644 index 000000000..f39837dcd --- /dev/null +++ b/froide/foirequest/migrations/0061_foimessage_foirequest__email_m_304d80_idx.py @@ -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" + ), + ), + ] diff --git a/froide/foirequest/models/message.py b/froide/foirequest/models/message.py index f3f5e2b6d..cc4ccb9fe 100644 --- a/froide/foirequest/models/message.py +++ b/froide/foirequest/models/message.py @@ -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,