# Generated by Django 2.2.8 on 2022-05-24 13:30

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


class Migration(migrations.Migration):

    dependencies = [
        ('departments', '0007_auto_20220520_1447'),
    ]

    operations = [
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='最后更新时间')),
                ('name', models.CharField(max_length=32, verbose_name='角色名称')),
                ('desc', models.CharField(blank=True, max_length=255, null=True, verbose_name='角色描述')),
                ('code', models.CharField(max_length=32, unique=True, verbose_name='角色code')),
                ('organization_id', models.IntegerField(verbose_name='组织id')),
                ('is_deleted', models.BooleanField(default=False, verbose_name='是否已经被删除')),
                ('is_edited', models.BooleanField(default=False, verbose_name='是否可以编辑')),
            ],
            options={
                'verbose_name': '角色',
                'db_table': 'middle_roles',
            },
        ),
        migrations.CreateModel(
            name='UserRole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='最后更新时间')),
                ('user_id', models.IntegerField(verbose_name='用户ID')),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='departments.Role', verbose_name='角色')),
            ],
            options={
                'verbose_name': '用户角色关系表',
                'db_table': 'middle_user_roles',
            },
        ),
    ]
