# Generated by Django 4.2.18 on 2025-01-27 11:24

from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("django_orghierarchy", "0011_alter_datasource_user_editable_organizations"),
    ]

    operations = [
        migrations.AlterUniqueTogether(
            name="organization",
            unique_together=set(),
        ),
        migrations.AlterUniqueTogether(
            name="organizationclass",
            unique_together=set(),
        ),
        migrations.AddConstraint(
            model_name="organization",
            constraint=models.UniqueConstraint(
                fields=("data_source", "origin_id"),
                name="django_orghierarchy_organization_data_source_and_origin_id_unique",
            ),
        ),
        migrations.AddConstraint(
            model_name="organization",
            constraint=models.UniqueConstraint(
                condition=models.Q(("data_source__isnull", True)),
                fields=("origin_id",),
                name="django_orghierarchy_organization_origin_id_unique_if_data_source_null",
            ),
        ),
        migrations.AddConstraint(
            model_name="organizationclass",
            constraint=models.UniqueConstraint(
                fields=("data_source", "origin_id"),
                name="django_orghierarchy_organizationclass_data_source_and_origin_id_unique",
            ),
        ),
        migrations.AddConstraint(
            model_name="organizationclass",
            constraint=models.UniqueConstraint(
                condition=models.Q(("data_source__isnull", True)),
                fields=("origin_id",),
                name="django_orghierarchy_organizationclass_origin_id_unique_if_data_source_null",
            ),
        ),
    ]
