diff --git a/uniticket/uni_ticket/migrations/0014_ticket_uni_ticket__code_3920e0_idx_and_more.py b/uniticket/uni_ticket/migrations/0014_ticket_uni_ticket__code_3920e0_idx_and_more.py new file mode 100644 index 00000000..0db1e4d8 --- /dev/null +++ b/uniticket/uni_ticket/migrations/0014_ticket_uni_ticket__code_3920e0_idx_and_more.py @@ -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" + ), + ), + ] diff --git a/uniticket/uni_ticket/models.py b/uniticket/uni_ticket/models.py index 57ebd6b9..b60ce287 100644 --- a/uniticket/uni_ticket/models.py +++ b/uniticket/uni_ticket/models.py @@ -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,