# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-02 06:36
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=16, verbose_name='权限组名')),
            ],
            options={
                'verbose_name_plural': '权限组表',
            },
        ),
        migrations.CreateModel(
            name='Menu',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=16)),
            ],
            options={
                'verbose_name_plural': '菜单表',
            },
        ),
        migrations.CreateModel(
            name='Permission',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('url', models.CharField(max_length=64, verbose_name='权限url路径')),
                ('feature', models.CharField(max_length=16, verbose_name='权限对应功能')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rbac.Group', verbose_name='所属权限组')),
                ('group_menu', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='rbac.Permission', verbose_name='组内菜单')),
            ],
            options={
                'verbose_name_plural': '权限表',
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=32, verbose_name='角色名')),
                ('permissions', models.ManyToManyField(to='rbac.Permission', verbose_name='角色拥有的权限')),
            ],
            options={
                'verbose_name_plural': '角色表',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('username', models.CharField(max_length=16, verbose_name='用户名')),
                ('password', models.CharField(max_length=32, verbose_name='登录密码')),
                ('roles', models.ManyToManyField(to='rbac.Role', verbose_name='用户拥有的角色')),
            ],
            options={
                'verbose_name_plural': '用户表',
            },
        ),
        migrations.AddField(
            model_name='group',
            name='menu',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rbac.Menu', verbose_name='所属菜单'),
        ),
    ]
