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 17, 2023
1 parent 5ebfd91 commit 1aade0f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.5 on 2023-10-17 06:56

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("uni_ticket", "0013_ticketassignment_uni_ticket__office__f42ab9_idx"),
]

operations = [
migrations.AddIndex(
model_name="ticket",
index=models.Index(fields=["code"], name="uni_ticket__code_3920e0_idx"),
),
migrations.AddIndex(
model_name="ticket",
index=models.Index(
fields=["is_closed"], name="uni_ticket__is_clos_8d6d43_idx"
),
),
migrations.AddIndex(
model_name="ticket",
index=models.Index(
fields=["assigned_date"], name="uni_ticket__assigne_b1e790_idx"
),
),
]
5 changes: 5 additions & 0 deletions uniticket/uni_ticket/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,11 @@ class Meta:
]
verbose_name = _("Ticket")
verbose_name_plural = _("Ticket")
indexes = [
models.Index(fields=['code',]),
models.Index(fields=['is_closed',]),
models.Index(fields=['assigned_date',]),
]

@property
def taken_date(self):
Expand Down

0 comments on commit 1aade0f

Please sign in to comment.