# Generated by Django 3.1.1 on 2020-09-18 17:28

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(help_text='管理员账号', max_length=255)),
                ('password', models.CharField(help_text='管理员密码', max_length=255)),
                ('degree', models.SmallIntegerField(help_text='管理员级别：1/超级管理员；2/普通管理员')),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
            ],
            options={
                'db_table': 'ums_admin',
            },
        ),
        migrations.CreateModel(
            name='Area',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('province', models.CharField(help_text='省/直辖市', max_length=255, null=True)),
                ('city', models.CharField(help_text='市/县级市', max_length=255, null=True)),
                ('district', models.CharField(help_text='区/县', max_length=255, null=True)),
                ('area_code', models.CharField(help_text='行政区划码', max_length=6, null=True)),
            ],
            options={
                'db_table': 'ums_area',
            },
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(help_text='文章标题', max_length=255, null=True)),
                ('content_text', models.TextField(blank=True, help_text='文章正文纯文本格式', null=True)),
                ('content_html', models.TextField(blank=True, help_text='文章正文html格式', null=True)),
                ('content_json', models.TextField(blank=True, help_text='文章正文json格式', null=True)),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
            ],
            options={
                'db_table': 'cms_article',
            },
        ),
        migrations.CreateModel(
            name='Label',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_name', models.CharField(help_text='标签名', max_length=255)),
                ('description', models.CharField(help_text='标签描述', max_length=1024, null=True)),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
            ],
            options={
                'db_table': 'cms_label',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.CharField(help_text='用户唯一标识', max_length=255)),
                ('username', models.CharField(help_text='用户名', max_length=255)),
                ('password', models.CharField(help_text='密码', max_length=255)),
                ('nickname', models.CharField(help_text='昵称', max_length=255, null=True)),
                ('realName', models.CharField(help_text='真实姓名', max_length=255, null=True)),
                ('gender', models.BooleanField(help_text='性别', null=True)),
                ('email', models.CharField(help_text='邮箱', max_length=255, null=True)),
                ('tel', models.CharField(help_text='手机号码（11位）', max_length=11, null=True)),
                ('logo_url', models.CharField(blank=True, help_text='头像图片地址', max_length=255, null=True)),
                ('socre', models.IntegerField(default=0, help_text='积分')),
                ('enable', models.BooleanField(default=True, help_text='账号启用状态，0/禁用，1/启用')),
                ('birth', models.DateField(blank=True, help_text='生日', null=True)),
                ('address', models.CharField(blank=True, help_text='详细地址', max_length=255, null=True)),
                ('personalInfo', models.CharField(blank=True, help_text='个人简介', max_length=255, null=True)),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
                ('areaCode', models.ForeignKey(help_text='行政区划码', null=True, on_delete=django.db.models.deletion.SET_NULL, to='zooapi.area')),
            ],
            options={
                'db_table': 'ums_user',
            },
        ),
        migrations.CreateModel(
            name='Subscribe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
                ('subscribe_id', models.ForeignKey(db_column='subscribe_id', help_text='关注者的id', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='zooapi.user')),
                ('user_id', models.ForeignKey(db_column='user_id', help_text='被关注者的id', on_delete=django.db.models.deletion.CASCADE, to='zooapi.user')),
            ],
            options={
                'db_table': 'ums_subscribe',
            },
        ),
        migrations.CreateModel(
            name='MidArticleLabel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
                ('article_id', models.ForeignKey(db_column='article_id', help_text='文章id，外键', on_delete=django.db.models.deletion.CASCADE, to='zooapi.article')),
                ('label_id', models.ForeignKey(db_column='label_id', help_text='标签id，外键', on_delete=django.db.models.deletion.CASCADE, to='zooapi.label')),
            ],
            options={
                'db_table': 'cms_mid_article_article',
            },
        ),
        migrations.CreateModel(
            name='Like',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('operate_type', models.BooleanField(help_text='操作类型：True喜欢/False不喜欢')),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
                ('article_id', models.ForeignKey(db_column='article_id', help_text='文章id，外键', on_delete=django.db.models.deletion.CASCADE, to='zooapi.article')),
                ('operator_id', models.ForeignKey(db_column='operator_id', help_text='用户id，外键', null=True, on_delete=django.db.models.deletion.SET_NULL, to='zooapi.user')),
            ],
            options={
                'db_table': 'cms_like',
            },
        ),
        migrations.AddField(
            model_name='label',
            name='creator_id',
            field=models.ForeignKey(db_column='creator_id', help_text='创建者id', null=True, on_delete=django.db.models.deletion.SET_NULL, to='zooapi.user'),
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image_name', models.CharField(help_text='图片名称', max_length=255)),
                ('image_url', models.FilePathField(help_text='图片路径')),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
                ('creator_id', models.ForeignKey(db_column='creator_id', help_text='创建者id', on_delete=django.db.models.deletion.CASCADE, to='zooapi.user')),
            ],
            options={
                'db_table': 'rms_image',
            },
        ),
        migrations.CreateModel(
            name='Folder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('folder_name', models.CharField(help_text='文件夹名', max_length=255)),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
                ('creator_id', models.ForeignKey(db_column='creator_id', help_text='创建者id', on_delete=django.db.models.deletion.CASCADE, to='zooapi.user')),
                ('parent_folder_id', models.ForeignKey(blank=True, db_column='parent_folder_id', help_text='上一级目录id，自关联关系', null=True, on_delete=django.db.models.deletion.PROTECT, to='zooapi.folder')),
            ],
            options={
                'db_table': 'cms_folder',
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment_text', models.CharField(help_text='评论内容文本', max_length=1024)),
                ('createTime', models.DateTimeField(auto_now_add=True, help_text='创建时间')),
                ('updateTime', models.DateTimeField(auto_now=True, help_text='更新时间')),
                ('article_id', models.ForeignKey(db_column='article_id', help_text='文章id，外键', on_delete=django.db.models.deletion.CASCADE, to='zooapi.article')),
                ('creator_id', models.ForeignKey(db_column='creator_id', help_text='创建者id', on_delete=django.db.models.deletion.CASCADE, to='zooapi.user')),
                ('parent_comment_id', models.ForeignKey(blank=True, db_column='parent_comment_id', help_text='上一级评论id，自关联关系', null=True, on_delete=django.db.models.deletion.CASCADE, to='zooapi.comment')),
            ],
            options={
                'db_table': 'cms_comment',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='creator_id',
            field=models.ForeignKey(db_column='creator_id', help_text='创建者id', on_delete=django.db.models.deletion.CASCADE, to='zooapi.user'),
        ),
        migrations.AddField(
            model_name='article',
            name='folder_id',
            field=models.ForeignKey(blank=True, db_column='folder_id', help_text='文章所属文件夹', null=True, on_delete=django.db.models.deletion.SET_NULL, to='zooapi.folder'),
        ),
    ]
