# Generated by Django 3.1.4 on 2021-04-17 08:53

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('rbac', '0002_auto_20210417_0844'),
    ]

    operations = [
        migrations.CreateModel(
            name='Menu',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='菜单名')),
                ('icon', models.CharField(blank=True, max_length=32, null=True, verbose_name='菜单图标')),
                ('priority', models.IntegerField(blank=True, help_text='菜单的显示顺序，优先级越小显示越靠前', null=True, verbose_name='显示优先级')),
                ('parent', models.ForeignKey(blank=True, help_text='如果添加的是子菜单，请选择父菜单', null=True, on_delete=django.db.models.deletion.CASCADE, to='rbac.menu', verbose_name='父级菜单')),
            ],
            options={
                'verbose_name': '菜单表',
                'verbose_name_plural': '菜单表',
                'ordering': ['priority', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Permission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='权限名')),
                ('url', models.CharField(blank=True, help_text='是否给菜单设置一个url地址', max_length=300, null=True, verbose_name='权限url地址')),
                ('icon', models.CharField(blank=True, max_length=32, null=True, verbose_name='权限图标')),
                ('menu', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='rbac.menu', verbose_name='对应菜单')),
                ('parent', models.ForeignKey(blank=True, help_text='如果添加的是子权限，请选择父权限', null=True, on_delete=django.db.models.deletion.CASCADE, to='rbac.permission', verbose_name='父级权限')),
            ],
            options={
                'verbose_name': '权限表',
                'verbose_name_plural': '权限表',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=32, verbose_name='角色名称')),
                ('permission', models.ManyToManyField(to='rbac.Permission')),
            ],
        ),
    ]
