# Generated by Django 5.2.7 on 2025-12-24 16:39

from django.db import migrations, models

import debusine.artifacts.models
import debusine.tasks.models


class Migration(migrations.Migration):
    dependencies = [
        ('db', '0037_collection_fields_help_text'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='worker',
            name='db_worker_celery_or_token',
        ),
        migrations.AddConstraint(
            model_name='worker',
            constraint=models.CheckConstraint(
                check=models.Q(
                    ('worker_type', debusine.tasks.models.WorkerType['CELERY']),
                    ('activation_token__isnull', False),
                    ('token__isnull', False),
                    models.Q(
                        ('instance_created_at__isnull', True),
                        ('worker_pool_id__isnull', False),
                    ),
                    _connector='OR',
                ),
                name='db_worker_celery_or_token',
            ),
        ),
    ]
