import django.db.models.deletion from django.db import migrations, models from django.db.models import Q class Migration(migrations.Migration): dependencies = [ ("channels", "0001_initial"), ("tickets", "0014_customerreplytask_channel_approval"), ] operations = [ migrations.AddField( model_name="channelmessage", name="customer_reply_task", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="channel_messages", to="tickets.customerreplytask", ), ), migrations.AddField( model_name="channelmessage", name="reply_revision", field=models.PositiveIntegerField(blank=True, null=True), ), migrations.AddConstraint( model_name="channelmessage", constraint=models.UniqueConstraint( fields=("customer_reply_task", "reply_revision"), condition=Q( direction="outbound", customer_reply_task__isnull=False, ), name="unique_channel_reply_revision", ), ), ]