# Generated by Django 3.2.19 on 2024-05-10 12:58

from django.db import migrations, models

import debusine.db.constraints


class Migration(migrations.Migration):

    dependencies = [
        ('db', '0052_collection_workflow_final'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='collectionitem',
            name='db_collectionitem_unique_debian_environment',
        ),
        migrations.AddConstraint(
            model_name='collectionitem',
            constraint=debusine.db.constraints.JsonDataUniqueConstraint(
                condition=models.Q(
                    ('category', 'debian:environments'),
                    ('removed_at__isnull', True),
                ),
                fields=(
                    "data->>'codename'",
                    "data->>'architecture'",
                    "data->>'variant'",
                    'parent_collection',
                ),
                name='db_collectionitem_unique_debian_environments',
                nulls_distinct=False,
            ),
        ),
    ]
