42 lines
1.4 KiB
Python
42 lines
1.4 KiB
Python
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
("tickets", "0013_ticketsupportanalysis_applied_solution_and_more"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name="customerreplytask",
|
|
name="approved_at",
|
|
field=models.DateTimeField(blank=True, null=True),
|
|
),
|
|
migrations.AddField(
|
|
model_name="customerreplytask",
|
|
name="approved_by",
|
|
field=models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="approved_customer_reply_tasks",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
migrations.RemoveConstraint(
|
|
model_name="customerreplytask",
|
|
name="unique_active_customer_reply_task",
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name="customerreplytask",
|
|
constraint=models.UniqueConstraint(
|
|
condition=models.Q(("status__in", ["draft", "approved"])),
|
|
fields=("ticket",),
|
|
name="unique_active_customer_reply_task",
|
|
),
|
|
),
|
|
]
|