# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2020-05-22 10:16
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('goods', '0013_auto_20200506_1855'),
    ]

    operations = [
        migrations.CreateModel(
            name='Administrator',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('name', models.CharField(max_length=15, verbose_name='员工名称')),
                ('username', models.CharField(max_length=150, verbose_name='用户名称')),
                ('password', models.CharField(max_length=200, verbose_name='用户密码')),
                ('status', models.BooleanField(default=True, verbose_name='是否启用')),
            ],
            options={
                'verbose_name': '管理员表',
                'verbose_name_plural': '管理员表',
                'db_table': 'tb_admin_user',
            },
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('name', models.CharField(max_length=100, verbose_name='资源名称')),
                ('link_url', models.CharField(max_length=200, verbose_name='跳转的url')),
                ('status', models.BooleanField(default=True, verbose_name='是否启用')),
            ],
            options={
                'verbose_name': '资源表',
                'verbose_name_plural': '资源表',
                'db_table': 'tb_resource',
            },
        ),
        migrations.CreateModel(
            name='ResourceAdmin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '资源权限表',
                'db_table': 'tb_resource_admin',
            },
        ),
        migrations.CreateModel(
            name='ResourcePermissions',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('admin', models.CharField(max_length=20, verbose_name='资源权限')),
            ],
            options={
                'verbose_name': '权限表',
                'db_table': 'tb_resource_permissions',
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('name', models.CharField(max_length=100, verbose_name='角色名称')),
                ('status', models.BooleanField(default=True, verbose_name='是否启用')),
            ],
            options={
                'verbose_name': '角色表',
                'verbose_name_plural': '角色表',
                'db_table': 'tb_role',
            },
        ),
        migrations.CreateModel(
            name='RoleResource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Resource', verbose_name='资源外键')),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Role', verbose_name='角色外键')),
            ],
            options={
                'verbose_name': '角色资源表',
                'verbose_name_plural': '角色资源表',
                'db_table': 'tb_role_resource',
            },
        ),
        migrations.AddField(
            model_name='resourceadmin',
            name='admin',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.ResourcePermissions', verbose_name='资源外键'),
        ),
        migrations.AddField(
            model_name='resourceadmin',
            name='resource',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Resource', verbose_name='角色外键'),
        ),
        migrations.AddField(
            model_name='administrator',
            name='role',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Role', verbose_name='外键关联角色表'),
        ),
    ]
