# Generated by Django 3.1.4 on 2022-03-10 19:11

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='PermCategory',
            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='Permission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content_type_id', models.IntegerField(blank=True, null=True, verbose_name='Django content id')),
                ('name', models.CharField(max_length=30, verbose_name='权限名')),
                ('method', models.CharField(blank=True, choices=[('POST', '增'), ('DELETE', '删'), ('PUT', '改'), ('PATCH', '局部改'), ('GET', '查')], max_length=8, null=True, verbose_name='方法')),
                ('path', models.CharField(blank=True, max_length=200, null=True, verbose_name='请求路径正则')),
                ('desc', models.CharField(blank=True, max_length=30, null=True, verbose_name='权限描述')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='system.permcategory', verbose_name='权限分类')),
                ('pid', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='system.permission', verbose_name='父权限')),
            ],
            options={
                'verbose_name': '权限',
                'verbose_name_plural': '权限',
                'ordering': ['id'],
                'unique_together': {('content_type_id', 'method')},
            },
        ),
    ]
