# Generated by Django 4.2.15 on 2024-10-16 20:59

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


class Migration(migrations.Migration):
    dependencies = [
        ('db', '0087_django_json_encoder'),
    ]

    operations = [
        migrations.CreateModel(
            name='ScopeRole',
            fields=[
                (
                    'id',
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'role',
                    models.CharField(
                        choices=[('owner', 'Owner')], max_length=16
                    ),
                ),
                (
                    'group',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name='scope_roles',
                        to='db.group',
                    ),
                ),
                (
                    'scope',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name='roles',
                        to='db.scope',
                    ),
                ),
            ],
        ),
        migrations.AddConstraint(
            model_name='scoperole',
            constraint=models.UniqueConstraint(
                fields=('scope', 'group', 'role'),
                name='db_scoperole_unique_scope_group_role',
            ),
        ),
    ]
