diff --git a/uniticket/uni_ticket/migrations/0022_ticketassignment_uni_ticket__ticket__c1f3e0_idx.py b/uniticket/uni_ticket/migrations/0022_ticketassignment_uni_ticket__ticket__c1f3e0_idx.py new file mode 100644 index 00000000..5eb3a673 --- /dev/null +++ b/uniticket/uni_ticket/migrations/0022_ticketassignment_uni_ticket__ticket__c1f3e0_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.9 on 2024-10-25 11:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uni_ticket', '0021_alter_task_options_alter_ticketcategorytask_options_and_more'), + ] + + operations = [ + migrations.AddIndex( + model_name='ticketassignment', + index=models.Index(fields=['ticket_id'], name='uni_ticket__ticket__c1f3e0_idx'), + ), + ] diff --git a/uniticket/uni_ticket/models.py b/uniticket/uni_ticket/models.py index 32558667..a2a27998 100644 --- a/uniticket/uni_ticket/models.py +++ b/uniticket/uni_ticket/models.py @@ -1186,7 +1186,8 @@ class TicketAssignment(TimeStampedModel): class Meta: unique_together = ("ticket", "office") ordering = ["created"] - indexes = [models.Index(fields=["office_id", "follow"])] + indexes = [models.Index(fields=["ticket_id"]), + models.Index(fields=["office_id", "follow"])] verbose_name = _("Competenza Ticket") verbose_name_plural = _("Competenza Ticket")