# Generated by Django 5.2.8 on 2025-12-06 15:03

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("meta", "0001_initial"),
        ("sites", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="whatsappchatbridge",
            name="site",
            field=models.ForeignKey(
                blank=True,
                help_text="Restrict this bridge to a specific site. Leave blank to use it as a fallback.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="whatsapp_chat_bridges",
                to="sites.site",
            ),
        ),
        migrations.AddConstraint(
            model_name="whatsappchatbridge",
            constraint=models.UniqueConstraint(
                condition=models.Q(("site__isnull", False)),
                fields=("site",),
                name="unique_whatsapp_chat_bridge_site",
            ),
        ),
        migrations.AddConstraint(
            model_name="whatsappchatbridge",
            constraint=models.UniqueConstraint(
                condition=models.Q(("is_default", True)),
                fields=("is_default",),
                name="single_default_whatsapp_chat_bridge",
            ),
        ),
    ]
