# Generated by Django 2.2.5 on 2019-09-14 13:57

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Articles',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('belong_to', models.PositiveIntegerField(blank=True, null=True, verbose_name='属于对象')),
                ('title', models.CharField(blank=True, default='', max_length=80, null=True, verbose_name='标题')),
                ('content', models.TextField(blank=True, default='', null=True, verbose_name='内容')),
                ('type', models.CharField(choices=[('detail', '图文详情'), ('ad', '广告素材'), ('blog', '文章'), ('public', '系统公告'), ('message', '私信')], default='', max_length=10, verbose_name='文章类型')),
                ('access_count', models.IntegerField(default=0, verbose_name='浏览次数')),
                ('like_count', models.IntegerField(default=0, verbose_name='点赞次数')),
                ('favorite_count', models.IntegerField(default=0, verbose_name='收藏次数')),
            ],
            options={
                'verbose_name': '文章',
                'verbose_name_plural': '文章',
                'db_table': 't_articles',
                'ordering': ('-sort', '-add_time'),
            },
        ),
        migrations.CreateModel(
            name='InteractedArticle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('type', models.CharField(choices=[('like', '点赞'), ('fav', '收藏'), ('watched', '看过')], max_length=20, verbose_name='行为')),
            ],
            options={
                'verbose_name': '互动内容记录',
                'verbose_name_plural': '互动内容记录',
                'db_table': 't_interacted_articles',
                'ordering': ('-add_time',),
            },
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('title', models.CharField(blank=True, default='', max_length=80, null=True, verbose_name='标题')),
                ('content', models.TextField(blank=True, default='', null=True, verbose_name='内容')),
                ('is_topping', models.BooleanField(default=False, verbose_name='是否置顶')),
            ],
            options={
                'verbose_name': '消息',
                'verbose_name_plural': '消息',
                'db_table': 't_messages',
                'ordering': ('-sort', '-add_time'),
            },
        ),
        migrations.CreateModel(
            name='MessageRecipient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('is_topping', models.BooleanField(default=False, verbose_name='是否置顶')),
                ('is_watched', models.BooleanField(default=False, verbose_name='是否已读')),
                ('message', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='recipients', to='community.Message', verbose_name='消息')),
            ],
            options={
                'verbose_name': '消息接受人',
                'verbose_name_plural': '消息接受人',
                'db_table': 't_message_recipients',
                'ordering': ('-sort', '-add_time'),
            },
        ),
    ]
