# Generated by Django 5.2

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0094_persistentagent_organization_fk'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='persistentagent',
            name='unique_persistent_agent_user_name',
        ),
        migrations.AddConstraint(
            model_name='persistentagent',
            constraint=models.UniqueConstraint(
                fields=('user', 'name'),
                name='unique_persistent_agent_user_name',
                condition=models.Q(('organization__isnull', True)),
            ),
        ),
        migrations.AddConstraint(
            model_name='persistentagent',
            constraint=models.UniqueConstraint(
                fields=('organization', 'name'),
                name='unique_persistent_agent_org_name',
                condition=models.Q(('organization__isnull', False)),
            ),
        ),
    ]

