# Generated by Django 3.2.19 on 2024-06-03 15:12

from django.db import migrations, models

import debusine.tasks.models


class Migration(migrations.Migration):

    dependencies = [
        ('db', '0062_rename_internalnoop'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='worker',
            name='db_worker_internal_or_token',
        ),
        migrations.AddField(
            model_name='worker',
            name='worker_type',
            field=models.CharField(
                choices=[
                    (
                        debusine.tasks.models.WorkerType['EXTERNAL'],
                        debusine.tasks.models.WorkerType['EXTERNAL'],
                    ),
                    (
                        debusine.tasks.models.WorkerType['CELERY'],
                        debusine.tasks.models.WorkerType['CELERY'],
                    ),
                ],
                default=debusine.tasks.models.WorkerType['EXTERNAL'],
                editable=False,
                max_length=8,
            ),
        ),
        migrations.AddConstraint(
            model_name='worker',
            constraint=models.CheckConstraint(
                check=models.Q(
                    ('internal', True),
                    ('worker_type', debusine.tasks.models.WorkerType['CELERY']),
                    ('token__isnull', False),
                    _connector='OR',
                ),
                name='db_worker_celery_or_token',
            ),
        ),
    ]
