From 50f8e392135063ae1f5c8991b1ec94bd37626abb Mon Sep 17 00:00:00 2001 From: Francesco Filicetti Date: Tue, 12 Nov 2024 09:44:40 +0100 Subject: [PATCH] fix: db indexes --- .../0024_ticket_uni_ticket__id_1dfb83_idx.py | 17 +++++++++++++++++ uniticket/uni_ticket/models.py | 1 + 2 files changed, 18 insertions(+) create mode 100644 uniticket/uni_ticket/migrations/0024_ticket_uni_ticket__id_1dfb83_idx.py diff --git a/uniticket/uni_ticket/migrations/0024_ticket_uni_ticket__id_1dfb83_idx.py b/uniticket/uni_ticket/migrations/0024_ticket_uni_ticket__id_1dfb83_idx.py new file mode 100644 index 0000000..001b29a --- /dev/null +++ b/uniticket/uni_ticket/migrations/0024_ticket_uni_ticket__id_1dfb83_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.16 on 2024-11-12 08:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uni_ticket', '0023_remove_ticketassignment_uni_ticket__office__f42ab9_idx_and_more'), + ] + + operations = [ + migrations.AddIndex( + model_name='ticket', + index=models.Index(fields=['id', 'is_closed', 'created'], name='uni_ticket__id_1dfb83_idx'), + ), + ] diff --git a/uniticket/uni_ticket/models.py b/uniticket/uni_ticket/models.py index b706049..1cb8c8e 100644 --- a/uniticket/uni_ticket/models.py +++ b/uniticket/uni_ticket/models.py @@ -503,6 +503,7 @@ class Meta: ] verbose_name = _("Ticket") verbose_name_plural = _("Ticket") + indexes = [models.Index(fields=["id", "is_closed", "created"])] @property def taken_date(self):