# Generated by Django 2.1 on 2019-04-09 06:05

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BusinessSystem',
            fields=[
                ('create_login_name', models.CharField(max_length=50)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('system_code', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('system_name', models.CharField(max_length=50)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_login_name', models.CharField(max_length=50)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('system_code', models.CharField(max_length=50)),
                ('resource_code', models.CharField(max_length=40)),
                ('resource_name', models.CharField(max_length=40)),
                ('resource_path', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_login_name', models.CharField(max_length=50)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('system_code', models.CharField(max_length=50)),
                ('role_code', models.CharField(max_length=50)),
                ('role_name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='RoleResource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_login_name', models.CharField(max_length=50)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('resource_code', models.CharField(max_length=40)),
                ('system_code', models.CharField(max_length=50)),
                ('role_code', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('create_login_name', models.CharField(max_length=50)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('login_name', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('password', models.CharField(max_length=50)),
                ('real_name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='UserRole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_login_name', models.CharField(max_length=50)),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('login_name', models.CharField(max_length=50)),
                ('system_code', models.CharField(max_length=50)),
                ('role_code', models.CharField(max_length=50)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='userrole',
            unique_together={('login_name', 'system_code', 'role_code')},
        ),
        migrations.AddIndex(
            model_name='user',
            index=models.Index(fields=['real_name'], name='general_use_real_na_fe1b75_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='roleresource',
            unique_together={('resource_code', 'system_code', 'role_code')},
        ),
        migrations.AddIndex(
            model_name='role',
            index=models.Index(fields=['role_name'], name='general_rol_role_na_de51b3_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='role',
            unique_together={('system_code', 'role_code')},
        ),
        migrations.AddIndex(
            model_name='resource',
            index=models.Index(fields=['system_code', 'resource_code'], name='general_res_system__c1df3e_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='resource',
            unique_together={('system_code', 'resource_code')},
        ),
    ]
