# Generated by Django 2.0.3 on 2019-05-29 22:17

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('rbac', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=16, verbose_name='部门名称')),
            ],
        ),
        migrations.CreateModel(
            name='Inform',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=32, verbose_name='标题')),
                ('content', models.TextField()),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='发布时间')),
                ('read', models.IntegerField(default=1, verbose_name='已读：0，未读：1')),
                ('status', models.IntegerField(default=1, verbose_name='状态 1：有效， 0:无效')),
            ],
        ),
        migrations.CreateModel(
            name='UserInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(blank=True, max_length=32, null=True, verbose_name='用户名')),
                ('password', models.CharField(blank=True, max_length=64, null=True, verbose_name='密码')),
                ('avatar', models.FileField(default='default.png', upload_to='avatars/', verbose_name='头像')),
                ('name', models.CharField(max_length=16, verbose_name='真实姓名')),
                ('phone', models.CharField(blank=True, max_length=32, null=True, verbose_name='手机号')),
                ('gender', models.IntegerField(choices=[(1, '男'), (2, '女')], default=1, verbose_name='性别')),
                ('email', models.EmailField(max_length=254, verbose_name='邮箱')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('depart', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='backstage.Department', verbose_name='部门')),
                ('roles', models.ManyToManyField(blank=True, to='rbac.Role', verbose_name='拥有的所有角色')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='inform',
            name='source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='source_re', to='backstage.UserInfo', verbose_name='发布者'),
        ),
        migrations.AddField(
            model_name='inform',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_re', to='backstage.UserInfo', verbose_name='关联的用户'),
        ),
    ]
