Skip to content

Commit

Permalink
fix: remove db indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 14, 2024
1 parent 4057a3a commit 990d4a1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.16 on 2024-11-14 09:35

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

dependencies = [
('uni_ticket', '0022_alter_ticket_is_closed'),
]

operations = [
migrations.RemoveIndex(
model_name='ticketassignment',
name='uni_ticket__office__f42ab9_idx',
),
migrations.AlterField(
model_name='ticket',
name='assigned_date',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='ticket',
name='code',
field=models.CharField(default=uuid.uuid4, max_length=255, unique=True),
),
]
6 changes: 3 additions & 3 deletions uniticket/uni_ticket/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ class Ticket(SavedFormContent):
Ticket
"""

code = models.CharField(max_length=255, unique=True, db_index=True, default=uuid.uuid4)
code = models.CharField(max_length=255, unique=True, default=uuid.uuid4)
subject = models.CharField(max_length=255)
description = models.TextField()
created = models.DateTimeField(auto_now_add=True)
Expand All @@ -469,7 +469,7 @@ class Ticket(SavedFormContent):
TicketCategoryModule, on_delete=models.PROTECT)
is_closed = models.BooleanField(default=False)
closed_date = models.DateTimeField(blank=True, null=True)
assigned_date = models.DateTimeField(blank=True, null=True, db_index=True)
assigned_date = models.DateTimeField(blank=True, null=True)
closed_by = models.ForeignKey(
get_user_model(),
on_delete=models.SET_NULL,
Expand Down Expand Up @@ -1186,7 +1186,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"])]
verbose_name = _("Competenza Ticket")
verbose_name_plural = _("Competenza Ticket")

Expand Down

0 comments on commit 990d4a1

Please sign in to comment.