# Generated by Django 3.0.5 on 2022-11-18 08:26

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('drf_rbac', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserRoleMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='drf_rbac.Role')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'User Role',
                'verbose_name_plural': 'User Role',
                'unique_together': {('user', 'role')},
            },
        ),
        migrations.AddField(
            model_name='role',
            name='user',
            field=models.ManyToManyField(blank=True, null=True, through='drf_rbac.UserRoleMembership', to=settings.AUTH_USER_MODEL, verbose_name='Related User-Role'),
        ),
    ]
