# Generated by Django 2.1.2 on 2018-11-06 03:15

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


class Migration(migrations.Migration):

    dependencies = [
        ('wadmin', '0004_auto_20181102_1819'),
    ]

    operations = [
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('seq', models.IntegerField(blank=True, default=0, null=True)),
                ('status', models.IntegerField(default=1)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('phone', models.CharField(blank=True, max_length=32, null=True)),
                ('email', models.CharField(blank=True, max_length=256, null=True)),
                ('address', models.CharField(blank=True, max_length=256, null=True)),
                ('desc', models.CharField(blank=True, max_length=512, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='LoginStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.CharField(max_length=128)),
                ('status', models.IntegerField(default=1)),
                ('active_time', models.IntegerField(default=5)),
                ('update_time', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        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)),
                ('per_type', models.IntegerField(default=0)),
                ('status', models.IntegerField(default=1)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('seq', models.IntegerField(blank=True, default=0, null=True)),
                ('url', models.CharField(blank=True, max_length=256, null=True)),
                ('icon', models.CharField(blank=True, max_length=32, null=True)),
                ('desc', models.CharField(blank=True, max_length=512, null=True)),
                ('pid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wadmin.Permission')),
            ],
        ),
        migrations.CreateModel(
            name='SQLPermission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('sql_id', models.CharField(max_length=128)),
                ('status', models.IntegerField(default=1)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('seq', models.IntegerField(blank=True, default=0, null=True)),
                ('desc', models.CharField(blank=True, max_length=512, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('account', models.CharField(max_length=32)),
                ('password', models.CharField(max_length=32)),
                ('name', models.CharField(blank=True, max_length=32, null=True)),
                ('user_type', models.IntegerField(default=0)),
                ('status', models.IntegerField(default=1)),
                ('create_time', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.RemoveField(
            model_name='group',
            name='mu',
        ),
        migrations.RemoveField(
            model_name='userinfo',
            name='group',
        ),
        migrations.RemoveField(
            model_name='userinfo',
            name='roles',
        ),
        migrations.AddField(
            model_name='role',
            name='create_time',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='role',
            name='desc',
            field=models.CharField(blank=True, max_length=512, null=True),
        ),
        migrations.AddField(
            model_name='role',
            name='is_all_sql_auth',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='role',
            name='seq',
            field=models.IntegerField(blank=True, default=0, null=True),
        ),
        migrations.AddField(
            model_name='role',
            name='status',
            field=models.IntegerField(default=1),
        ),
        migrations.DeleteModel(
            name='Group',
        ),
        migrations.DeleteModel(
            name='Menu',
        ),
        migrations.DeleteModel(
            name='UserInfo',
        ),
        migrations.AddField(
            model_name='user',
            name='roles',
            field=models.ManyToManyField(to='wadmin.Role'),
        ),
        migrations.AddField(
            model_name='loginstatus',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wadmin.User'),
        ),
        migrations.AddField(
            model_name='company',
            name='roles',
            field=models.ManyToManyField(to='wadmin.Role'),
        ),
        migrations.AddField(
            model_name='role',
            name='permissions',
            field=models.ManyToManyField(to='wadmin.Permission'),
        ),
        migrations.AddField(
            model_name='role',
            name='sql_permissions',
            field=models.ManyToManyField(to='wadmin.SQLPermission'),
        ),
    ]
