diff --git a/src/tickets/models.py b/src/tickets/models.py index 7274761..8ac59a5 100644 --- a/src/tickets/models.py +++ b/src/tickets/models.py @@ -20,6 +20,9 @@ class TicketPriority(models.Model): db_table = "ticket_priorities" verbose_name = "Ticket Priority" verbose_name_plural = "Ticket Priorities" + indexes = [ + models.Index(fields=["name"]), + ] def __str__(self): return self.name @@ -103,6 +106,12 @@ class Ticket(models.Model): models.Index(fields=["due_date"]), models.Index(fields=["priority"]), models.Index(fields=["created_by"]), + models.Index(fields=["epic"]), + models.Index(fields=["name"]), + models.Index(fields=["start_date"]), + models.Index(fields=["project", "name"]), + models.Index(fields=["project", "start_date", "due_date"]), + models.Index(fields=["due_date", "status"]), ] def __str__(self): @@ -190,6 +199,7 @@ class TicketComment(models.Model): verbose_name_plural = "Ticket Comments" indexes = [ models.Index(fields=["ticket", "created_at"]), + models.Index(fields=["user"]), ] def __str__(self):