# Generated by Django 2.2.1 on 2019-09-26 11:30

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='作者名字')),
                ('age', models.IntegerField(verbose_name='年龄')),
                ('gender', models.IntegerField(choices=[(1, '男'), (2, '女')], default=1, verbose_name='性别')),
                ('email', models.CharField(max_length=32, verbose_name='电子邮件')),
            ],
            options={
                'db_table': 'author',
                'verbose_name_plural': '作者',
                'verbose_name': '作者',
            },
        ),
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='名字')),
                ('description', models.TextField(verbose_name='描述')),
            ],
            options={
                'db_table': 'type',
                'verbose_name_plural': '类型',
                'verbose_name': '类型',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=32, verbose_name='用户名')),
                ('password', models.CharField(max_length=32, verbose_name='密码')),
                ('email', models.CharField(max_length=32, verbose_name='邮箱')),
            ],
            options={
                'db_table': 'user',
                'verbose_name_plural': '用户表',
                'verbose_name': '用户表',
            },
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(auto_created=True, verbose_name='日期')),
                ('title', models.CharField(max_length=32, verbose_name='标题')),
                ('content', ckeditor.fields.RichTextField()),
                ('description', ckeditor.fields.RichTextField()),
                ('picture', models.ImageField(upload_to='images')),
                ('recommend', models.IntegerField(default=0, verbose_name='推荐')),
                ('click', models.IntegerField(default=0, verbose_name='点击率')),
                ('author', models.ForeignKey(default=1, on_delete=django.db.models.deletion.SET_DEFAULT, to='blogindex.Author')),
                ('type', models.ManyToManyField(to='blogindex.Type')),
            ],
            options={
                'db_table': 'article',
                'verbose_name_plural': '文章',
                'verbose_name': '文章',
            },
        ),
    ]
