# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-27 12:58
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('nid', models.BigAutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=128, verbose_name='文章标题')),
                ('summary', models.CharField(max_length=255, verbose_name='文章简介')),
                ('read_count', models.IntegerField(default=0)),
                ('comment_count', models.IntegerField(default=0)),
                ('up_count', models.IntegerField(default=0)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('article_type_id', models.IntegerField(choices=[(1, '学习'), (2, '游戏'), (3, '感情'), (4, '生活')], default=None)),
            ],
        ),
        migrations.CreateModel(
            name='ArticleDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(verbose_name='文章内容')),
                ('article', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.Article', verbose_name='所属文章')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('nid', models.BigAutoField(primary_key=True, serialize=False)),
                ('content', models.CharField(max_length=255, verbose_name='评论内容')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Article', verbose_name='评论文章')),
            ],
        ),
        migrations.CreateModel(
            name='Reply',
            fields=[
                ('nid', models.BigAutoField(primary_key=True, serialize=False)),
                ('content', models.CharField(max_length=255, verbose_name='回复内容')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Article', verbose_name='回复文章')),
                ('comment_reply', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Comment', verbose_name='回复评论')),
            ],
        ),
        migrations.CreateModel(
            name='Up',
            fields=[
                ('nid', models.BigAutoField(primary_key=True, serialize=False)),
                ('up', models.BooleanField(verbose_name='是否赞')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Article', verbose_name='文章')),
            ],
        ),
        migrations.CreateModel(
            name='UserInfo',
            fields=[
                ('nid', models.BigAutoField(primary_key=True, serialize=False)),
                ('username', models.CharField(max_length=32, unique=True, verbose_name='用户名')),
                ('password', models.CharField(max_length=64, verbose_name='密码')),
                ('avatar', models.ImageField(default='static/imgs/avatar/default.png', upload_to='', verbose_name='头像')),
                ('qq', models.CharField(max_length=32, verbose_name='qq')),
                ('article_count', models.IntegerField(default=0, verbose_name='文章个数')),
            ],
        ),
        migrations.AddField(
            model_name='up',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.UserInfo', verbose_name='赞用户'),
        ),
        migrations.AddField(
            model_name='reply',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.UserInfo', verbose_name='回复用户'),
        ),
        migrations.AddField(
            model_name='comment',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.UserInfo', verbose_name='评论者'),
        ),
        migrations.AddField(
            model_name='article',
            name='author',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.UserInfo', verbose_name='作者'),
        ),
    ]
