# Generated by Django 4.2.15 on 2024-10-28 13:28

from django.db import migrations, models

import debusine.artifacts.models


class Migration(migrations.Migration):
    dependencies = [
        ('db', '0093_uniform_scoperole_resource_reference'),
    ]

    operations = [
        migrations.AddConstraint(
            model_name='collection',
            constraint=models.CheckConstraint(
                check=models.Q(
                    models.Q(
                        models.Q(
                            (
                                'category__in',
                                {
                                    debusine.artifacts.models.CollectionCategory[
                                        'PACKAGE_BUILD_LOGS'
                                    ],
                                    debusine.artifacts.models.CollectionCategory[
                                        'TASK_HISTORY'
                                    ],
                                },
                            ),
                            _negated=True,
                        ),
                        models.Q(('name__startswith', '_'), _negated=True),
                    ),
                    models.Q(
                        (
                            'category__in',
                            {
                                debusine.artifacts.models.CollectionCategory[
                                    'PACKAGE_BUILD_LOGS'
                                ],
                                debusine.artifacts.models.CollectionCategory[
                                    'TASK_HISTORY'
                                ],
                            },
                        ),
                        ('name', '_'),
                    ),
                    _connector='OR',
                ),
                name='db_collection_name_not_reserved',
            ),
        ),
    ]
