Skip to content

Commit

Permalink
fix: db indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 11, 2024
1 parent 23a5741 commit 1745898
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.16 on 2024-11-11 14:45

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='ticket',
index=models.Index(fields=['priority', 'created'], name='uni_ticket__priorit_0066dd_idx'),
),
migrations.AddIndex(
model_name='ticketassignment',
index=models.Index(fields=['ticket_id', 'follow'], name='uni_ticket__ticket__9822c1_idx'),
),
migrations.AddIndex(
model_name='ticketassignment',
index=models.Index(fields=['taken_date'], name='uni_ticket__taken_d_7d4fc6_idx'),
),
]
6 changes: 5 additions & 1 deletion uniticket/uni_ticket/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ class Meta:
"-created",
"code",
]
indexes = [models.Index(fields=["priority", "created"])]
verbose_name = _("Ticket")
verbose_name_plural = _("Ticket")

Expand Down Expand Up @@ -1186,7 +1187,10 @@ class TicketAssignment(TimeStampedModel):
class Meta:
unique_together = ("ticket", "office")
ordering = ["created"]
indexes = [models.Index(fields=["office_id", "follow"])]
indexes = [models.Index(fields=["office_id", "follow"]),
models.Index(fields=["ticket_id", "follow"]),
models.Index(fields=["taken_date"]),
]
verbose_name = _("Competenza Ticket")
verbose_name_plural = _("Competenza Ticket")

Expand Down

0 comments on commit 1745898

Please sign in to comment.