# Generated by Django 4.2.23 on 2026-01-08 10:36

import django.db.models.deletion
import django.db.models.functions.comparison
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ('db', '0040_workrequest_pending_at'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='group',
            name='db_group_unique_name_scope',
        ),
        migrations.AddField(
            model_name='group',
            name='workspace',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to='db.workspace',
            ),
        ),
        migrations.AddConstraint(
            model_name='group',
            constraint=models.UniqueConstraint(
                models.F('name'),
                models.F('scope'),
                django.db.models.functions.comparison.Coalesce(
                    'workspace', models.Value(-1)
                ),
                name='db_group_unique_name_scope_workspace',
            ),
        ),
    ]
