# Generated by Django 5.2.7 on 2026-04-27 15:53

from django.db import migrations, models

import debusine.assets.models


class Migration(migrations.Migration):
    dependencies = [
        ('db', '0054_scoperole_observer'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='asset',
            name='db_asset_workspace_not_null',
        ),
        migrations.AddConstraint(
            model_name='asset',
            constraint=models.CheckConstraint(
                check=models.Q(
                    models.Q(
                        (
                            'category',
                            debusine.assets.models.AssetCategory['SIGNING_KEY'],
                        ),
                        _negated=True,
                    ),
                    ('workspace__isnull', False),
                    _connector='OR',
                ),
                name='db_asset_workspace_not_null',
            ),
        ),
        migrations.AddField(
            model_name='workerpool',
            name='apt_authentication',
            field=models.ForeignKey(
                on_delete=models.deletion.PROTECT,
                related_name='+',
                to='db.asset',
                null=True,
                blank=True,
            ),
            preserve_default=False,
        ),
    ]
