# Generated by Django 3.0.4 on 2020-04-22 13:25

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('CategoryApp', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('questionTitle', models.CharField(max_length=40, unique=True, verbose_name='问题标题')),
                ('questionDescription', models.TextField(verbose_name='详细描述')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='发布日期')),
                ('publishDate', models.DateTimeField(auto_now=True, verbose_name='更新日期')),
                ('goodNum', models.IntegerField(default=0, verbose_name='赞数')),
                ('badNum', models.IntegerField(default=0, verbose_name='反对数')),
                ('grade', models.IntegerField(default=0, verbose_name='综合质量')),
                ('collect', models.ManyToManyField(to=settings.AUTH_USER_MODEL, verbose_name='收藏')),
                ('questionCategory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CategoryApp.Category', verbose_name='板块名称')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to=settings.AUTH_USER_MODEL, verbose_name='提问者')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('commentText', models.TextField(verbose_name='评论内容')),
                ('pubDate', models.DateTimeField(auto_now=True, verbose_name='回答时间')),
                ('goodNum', models.IntegerField(default=0)),
                ('badNum', models.IntegerField(default=0)),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='QuestionApp.Question')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='评论者')),
            ],
        ),
    ]
