# Generated by Django 2.0.3 on 2019-08-31 00:14

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Advertise',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(blank=True, max_length=24, null=True, verbose_name='宣传项目名称')),
                ('images', models.FileField(blank=True, null=True, upload_to='advertise/', verbose_name='宣传图片')),
                ('url', models.URLField(blank=True, null=True, verbose_name='相关URL')),
                ('place', models.CharField(max_length=10, verbose_name='位置')),
                ('status', models.IntegerField(default=1, verbose_name='状态 1：有效， 0:无效')),
                ('content', models.TextField(blank=True, null=True, verbose_name='描述信息')),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(blank=True, max_length=50, null=True, verbose_name='文章标题')),
                ('desc', models.CharField(blank=True, max_length=255, null=True, verbose_name='文章描述')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('content', models.TextField(blank=True, null=True, verbose_name='正文内容')),
                ('comm_count', models.IntegerField(default=0, verbose_name='评论数')),
                ('up_count', models.IntegerField(default=0, verbose_name='点赞数')),
                ('read_count', models.IntegerField(default=0, verbose_name='阅读数')),
                ('type', models.CharField(choices=[('html', 'html格式'), ('md', 'markdown格式'), ('text', '文本格式')], default='html', max_length=6, verbose_name='文章类型,html:text:md')),
                ('weight', models.IntegerField(default=0, verbose_name='文章权重')),
                ('status', models.IntegerField(default=1, verbose_name='状态 1：有效， 0:无效')),
            ],
        ),
        migrations.CreateModel(
            name='ArticleUpDown',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('is_up', models.BooleanField(default=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Article')),
            ],
        ),
        migrations.CreateModel(
            name='Buy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Article')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=32, verbose_name='分类标题')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('content', models.CharField(max_length=500, verbose_name='评论内容')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('like_count', models.IntegerField(default=0, verbose_name='点赞数')),
                ('reply_count', models.IntegerField(default=0, verbose_name='回复数')),
                ('status', models.IntegerField(default=1, verbose_name='评论状态，-1为删除，0为待审核，1为已发布')),
                ('send', models.BooleanField(default=False, verbose_name='是否发送，True为已发送，False为未发送')),
                ('ancestor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ancestor_comment', to='wxapi.Comment', verbose_name='主楼评论')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Article', verbose_name='评论文章')),
            ],
        ),
        migrations.CreateModel(
            name='CommentImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('commentId', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Comment', verbose_name='评论id')),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('username', models.CharField(max_length=120, verbose_name='用户名')),
                ('openid', models.CharField(blank=True, max_length=64, null=True, verbose_name='微信用户唯一标识openid')),
                ('telephone', models.CharField(blank=True, max_length=11, null=True, unique=True)),
                ('avatar', models.URLField(verbose_name='头像')),
                ('sex', models.IntegerField(choices=[(1, '男'), (2, '女')], default=1, verbose_name='性别')),
                ('province', models.CharField(blank=True, max_length=32, null=True, verbose_name='省份')),
                ('city', models.CharField(blank=True, max_length=32, null=True, verbose_name='城市')),
                ('email', models.EmailField(max_length=254, verbose_name='邮箱')),
                ('qq', models.CharField(blank=True, max_length=13, null=True, verbose_name='QQ')),
                ('wechat', models.CharField(blank=True, max_length=64, null=True, verbose_name='微信')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('asset', models.IntegerField(default=50, verbose_name='资产')),
                ('score', models.IntegerField(default=50, verbose_name='积分')),
                ('status', models.IntegerField(default=1, verbose_name='状态 1：有效， 0:无效')),
            ],
        ),
        migrations.CreateModel(
            name='Formid',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('formid', models.CharField(max_length=64, verbose_name='form_id')),
                ('expire', models.CharField(max_length=64, verbose_name='过期时间戳')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer', verbose_name='用户')),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('image', models.FileField(upload_to='images/', 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='发布时间')),
                ('status', models.IntegerField(default=1, verbose_name='状态 1：有效， 0:无效')),
            ],
        ),
        migrations.CreateModel(
            name='Inform2Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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:无效')),
                ('inform', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='wxapi.Inform', verbose_name='通知信息')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer', verbose_name='通知的用户')),
            ],
        ),
        migrations.CreateModel(
            name='Msg',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('describe', models.CharField(max_length=255, verbose_name='描述信息')),
                ('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:无效')),
                ('article', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wxapi.Article', verbose_name='关联的文章')),
                ('commentId', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wxapi.Comment', verbose_name='评论信息的id')),
                ('commentUserId', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='commentUser2id', to='wxapi.Customer', verbose_name='被评论用户的id')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user2id', to='wxapi.Customer', verbose_name='关联的用户')),
            ],
        ),
        migrations.CreateModel(
            name='Sign',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer', verbose_name='签到用户')),
            ],
        ),

        migrations.CreateModel(
            name='StudyLink',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('study_url', models.CharField(blank=True, max_length=255, null=True, verbose_name='分享学习资料的链接')),
                ('gold', models.IntegerField(default=0, verbose_name='多少金币兑换')),
            ],
        ),
        migrations.CreateModel(
            name='Trove',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Article', verbose_name='文章')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer', verbose_name='收藏文章的用户')),
            ],
        ),
        migrations.AddField(
            model_name='customer',
            name='inform',
            field=models.ManyToManyField(through='wxapi.Inform2Customer', to='wxapi.Inform'),
        ),
        migrations.AddField(
            model_name='customer',
            name='study_buy',
            field=models.ManyToManyField(through='wxapi.Buy', to='wxapi.Article'),
        ),
        migrations.AddField(
            model_name='commentimage',
            name='image',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Image', verbose_name='图片id'),
        ),
        migrations.AddField(
            model_name='comment',
            name='img',
            field=models.ManyToManyField(through='wxapi.CommentImage', to='wxapi.Image', verbose_name='评论中的图片'),
        ),
        migrations.AddField(
            model_name='comment',
            name='parent_comment',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='parent_comment_comm', to='wxapi.Comment', verbose_name='上一级评论'),
        ),
        migrations.AddField(
            model_name='comment',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer', verbose_name='评论者'),
        ),
        migrations.AddField(
            model_name='buy',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer'),
        ),
        migrations.AddField(
            model_name='articleupdown',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer'),
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wxapi.Category', verbose_name='分类'),
        ),
        migrations.AddField(
            model_name='article',
            name='img',
            field=models.ManyToManyField(to='wxapi.Image', verbose_name='图片'),
        ),
        migrations.AddField(
            model_name='article',
            name='study_url',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wxapi.StudyLink', verbose_name='分享学习资料的链接'),
        ),
        migrations.AddField(
            model_name='article',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wxapi.Customer', verbose_name='发布者'),
        ),
        migrations.AlterUniqueTogether(
            name='trove',
            unique_together={('user', 'article')},
        ),
        migrations.AlterUniqueTogether(
            name='buy',
            unique_together={('user', 'study')},
        ),
        migrations.AlterUniqueTogether(
            name='articleupdown',
            unique_together={('article', 'user')},
        ),
    ]
