# Generated by Django 2.2 on 2019-04-02 02:54

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Answer',
            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='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('approval_count', models.IntegerField(default=0, verbose_name='有用')),
                ('content', models.TextField(default='', verbose_name='回答内容')),
            ],
            options={
                'verbose_name': '回答',
                'verbose_name_plural': '回答',
                'db_table': 'tb_answers',
            },
        ),
        migrations.CreateModel(
            name='Question',
            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='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('approval_count', models.IntegerField(default=0, verbose_name='有用')),
                ('title', models.CharField(max_length=200, unique=True, verbose_name='问题标题')),
                ('view_count', models.IntegerField(default=0, verbose_name='浏览量')),
                ('detail_info', models.TextField(verbose_name='提问详情')),
            ],
            options={
                'verbose_name': '问题',
                'verbose_name_plural': '问题',
                'db_table': 'tb_questions',
            },
        ),
        migrations.CreateModel(
            name='Tag_Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cate_name', models.CharField(default='', max_length=30, verbose_name='标签分类')),
            ],
            options={
                'verbose_name': '标签分类',
                'verbose_name_plural': '标签分类',
                'db_table': 'tb_tag_categorys',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qs_answer.Tag_Category', verbose_name='标签')),
            ],
            options={
                'verbose_name': '标签',
                'verbose_name_plural': '标签',
                'db_table': 'tb_tags',
            },
        ),
        migrations.CreateModel(
            name='Question_Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qs_answer.Question', verbose_name='问题id')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qs_answer.Tag', verbose_name='标签id')),
            ],
            options={
                'verbose_name': '标签',
                'verbose_name_plural': '标签',
                'db_table': 'tb_questions_tags',
            },
        ),
    ]
