diff --git a/uniticket/uni_ticket/migrations/0023_remove_ticketassignment_uni_ticket__office__f42ab9_idx_and_more.py b/uniticket/uni_ticket/migrations/0023_remove_ticketassignment_uni_ticket__office__f42ab9_idx_and_more.py new file mode 100644 index 0000000..c36cec0 --- /dev/null +++ b/uniticket/uni_ticket/migrations/0023_remove_ticketassignment_uni_ticket__office__f42ab9_idx_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.16 on 2024-11-12 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uni_ticket', '0022_alter_ticket_is_closed'), + ] + + operations = [ + migrations.RemoveIndex( + model_name='ticketassignment', + name='uni_ticket__office__f42ab9_idx', + ), + migrations.AddIndex( + model_name='ticketassignment', + index=models.Index(fields=['ticket_id', 'office_id', 'follow'], name='uni_ticket__ticket__c4313e_idx'), + ), + ] diff --git a/uniticket/uni_ticket/models.py b/uniticket/uni_ticket/models.py index b491d3c..b706049 100644 --- a/uniticket/uni_ticket/models.py +++ b/uniticket/uni_ticket/models.py @@ -1186,7 +1186,7 @@ class TicketAssignment(TimeStampedModel): class Meta: unique_together = ("ticket", "office") ordering = ["created"] - indexes = [models.Index(fields=["office_id", "follow"])] + indexes = [models.Index(fields=["ticket_id", "office_id", "follow"])] verbose_name = _("Competenza Ticket") verbose_name_plural = _("Competenza Ticket")