# Generated by Django 3.2.7 on 2021-10-17 17:13

from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('workspaces', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Permission',
            fields=[
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('action', models.CharField(max_length=100)),
                ('ressource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='munity_permissions', to='contenttypes.contenttype')),
            ],
            options={
                'unique_together': {('ressource', 'action')},
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50, unique=True)),
                ('permissions', models.ManyToManyField(blank=True, to='authorization.Permission')),
                ('workspace', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='workspaces.workspace')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
