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

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("chats", "0003_initial"),
        ("groups", "0002_initial"),
        ("socials", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name="blueskyprofile",
            name="user",
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="discordprofile",
            name="avatar",
            field=models.OneToOneField(
                blank=True,
                help_text="Chat avatar that owns this profile.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="%(app_label)s_%(class)s",
                to="chats.chatavatar",
            ),
        ),
        migrations.AddField(
            model_name="discordprofile",
            name="group",
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="groups.securitygroup",
            ),
        ),
        migrations.AddField(
            model_name="discordprofile",
            name="user",
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddConstraint(
            model_name="blueskyprofile",
            constraint=models.UniqueConstraint(
                fields=("avatar",), name="blueskyprofile_avatar_unique"
            ),
        ),
        migrations.AddConstraint(
            model_name="blueskyprofile",
            constraint=models.UniqueConstraint(
                condition=models.Q(("handle", ""), _negated=True),
                fields=("handle",),
                name="blueskyprofile_handle_unique",
            ),
        ),
        migrations.AddConstraint(
            model_name="blueskyprofile",
            constraint=models.UniqueConstraint(
                condition=models.Q(("domain", ""), _negated=True),
                fields=("domain",),
                name="blueskyprofile_domain_unique",
            ),
        ),
        migrations.AddConstraint(
            model_name="discordprofile",
            constraint=models.UniqueConstraint(
                fields=("avatar",), name="discordprofile_avatar_unique"
            ),
        ),
        migrations.AddConstraint(
            model_name="discordprofile",
            constraint=models.UniqueConstraint(
                condition=models.Q(("guild_id", ""), _negated=True),
                fields=("guild_id",),
                name="discordprofile_guild_id_unique",
            ),
        ),
        migrations.AddConstraint(
            model_name="discordprofile",
            constraint=models.UniqueConstraint(
                condition=models.Q(("application_id", ""), _negated=True),
                fields=("application_id",),
                name="discordprofile_application_id_unique",
            ),
        ),
    ]
