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 Oct 25, 2024
1 parent 2902c3b commit 01bf8ba
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.9 on 2024-10-25 06: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.RemoveIndex(
model_name='ticketassignment',
name='uni_ticket__office__f42ab9_idx',
),
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=['office_id', 'follow', 'taken_date'], name='uni_ticket__office__54a01d_idx'),
),
]
3 changes: 2 additions & 1 deletion uniticket/uni_ticket/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ class Meta:
]
verbose_name = _("Ticket")
verbose_name_plural = _("Ticket")
indexes = [models.Index(fields=["priority", "created"])]

@property
def taken_date(self):
Expand Down Expand Up @@ -1186,7 +1187,7 @@ 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", "taken_date"])]
verbose_name = _("Competenza Ticket")
verbose_name_plural = _("Competenza Ticket")

Expand Down

0 comments on commit 01bf8ba

Please sign in to comment.