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 a877b10
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 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"
),
),
]
4 changes: 2 additions & 2 deletions uniticket/uni_ticket/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ class Ticket(SavedFormContent):
)
input_module = models.ForeignKey(
TicketCategoryModule, on_delete=models.PROTECT)
is_closed = models.BooleanField(default=False)
is_closed = models.BooleanField(default=False, db_index=True)
closed_date = models.DateTimeField(blank=True, null=True)
assigned_date = models.DateTimeField(blank=True, null=True)
assigned_date = models.DateTimeField(blank=True, null=True, db_index=True)
closed_by = models.ForeignKey(
get_user_model(),
on_delete=models.SET_NULL,
Expand Down

0 comments on commit a877b10

Please sign in to comment.