# Generated by Django 3.1.4 on 2021-12-25 16:07

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0265_companycfg_terminal_return'),
    ]

    operations = [
        migrations.CreateModel(
            name='PGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True, verbose_name='权限组名')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '权限组',
                'verbose_name_plural': '权限组',
            },
        ),
        migrations.CreateModel(
            name='Privilege',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='权限名称')),
                ('url', models.CharField(blank=True, max_length=128, null=True, verbose_name='含正则的URL')),
                ('is_menu', models.BooleanField(default=False, verbose_name='是否可以做菜单')),
                ('icon', models.CharField(blank=True, max_length=32, null=True, verbose_name='图标')),
                ('status', models.CharField(blank=True, max_length=10, null=True, verbose_name='状态')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('pgroup', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.pgroup', verbose_name='所属权限组')),
            ],
            options={
                'verbose_name': '功能权限',
                'verbose_name_plural': '功能权限',
            },
        ),
        migrations.AddField(
            model_name='cgroup',
            name='privileges',
            field=models.ManyToManyField(blank=True, to='company.Privilege', verbose_name='拥有的所有权限'),
        ),
    ]
