# Generated by Django 3.2.19 on 2024-05-12 12:34

import debusine.db.constraints
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('db', '0055_artifact_created_by_work_request_set_null'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='collectionitem',
            name='db_collectionitem_unique_debian_environments',
        ),
        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'",
                    "data->>'backend'",
                    'parent_collection',
                ),
                name='db_collectionitem_unique_debian_environments',
                nulls_distinct=False,
            ),
        ),
    ]
