# Generated by Django 2.2.6 on 2019-10-30 19:48

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('user_nick_name', models.CharField(default='', max_length=24, verbose_name='用户昵称')),
                ('user_gender', models.CharField(choices=[('1', '男'), ('0', '女')], default='1', max_length=10, verbose_name='性别选择')),
                ('user_birday', models.DateField(blank=True, null=True, verbose_name='用户生日')),
                ('user_detail', models.CharField(default='', max_length=200, verbose_name='个人简介')),
                ('user_image', models.ImageField(default='image/user/default.png', upload_to='image/user/%Y/%m', verbose_name='用户头像')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': '用户表',
                'verbose_name_plural': '用户表',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=20, verbose_name='分类名称')),
                ('detail', models.CharField(default='', max_length=100, verbose_name='分类介绍')),
                ('icon', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='分类图标')),
                ('sort_id', models.IntegerField(default=1, verbose_name='分类排序')),
            ],
            options={
                'verbose_name': '分类',
                'verbose_name_plural': '分类',
            },
        ),
        migrations.CreateModel(
            name='Word',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('word', models.CharField(max_length=99, unique=True, verbose_name='单词及语句')),
                ('ch_meaning', models.TextField(verbose_name='词语汉意')),
                ('word_tag', models.CharField(blank=True, default='', max_length=50, null=True, verbose_name='标签')),
                ('word_image', models.ImageField(default='image/default.png', upload_to='image/user/%Y/%m', verbose_name='单词配图')),
                ('istype', models.CharField(choices=[('0', '语句'), ('1', '单词')], default='1', max_length=10, verbose_name='类型选择')),
                ('word_create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('word_update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('categorys', models.ManyToManyField(to='app.Category')),
                ('word_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='数据录入者')),
            ],
            options={
                'verbose_name': '单词表',
                'verbose_name_plural': '单词表',
            },
        ),
        migrations.CreateModel(
            name='Questionbank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=99, unique=True, verbose_name='题库名称')),
                ('detail', models.CharField(default='', max_length=100, verbose_name='题库介绍')),
                ('q_create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('q_update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('byuser', models.ForeignKey(blank=True, default=1, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='byuser', to=settings.AUTH_USER_MODEL, verbose_name='题库拥有者（谁的题库）')),
                ('q_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='q_user', to=settings.AUTH_USER_MODEL, verbose_name='最后更新者')),
                ('words', models.ManyToManyField(to='app.Word', verbose_name='题库内容')),
            ],
            options={
                'verbose_name': '题库表',
                'verbose_name_plural': '题库表',
            },
        ),
        migrations.CreateModel(
            name='Examination_results',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.IntegerField(verbose_name='考试得分')),
                ('qbtime', models.IntegerField(verbose_name='考试所用时间（秒）')),
                ('e_create_time', models.DateTimeField(auto_now_add=True, verbose_name='本次考试时间')),
                ('e_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='考试者')),
                ('questionbank', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Questionbank', verbose_name='考试题库')),
            ],
            options={
                'verbose_name': '考试结果',
                'verbose_name_plural': '考试结果',
            },
        ),
        migrations.CreateModel(
            name='Answer_record',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.CharField(max_length=99, unique=True, verbose_name='用户答案')),
                ('isTrue', models.IntegerField(verbose_name='对错记录，0错1对')),
                ('ar_create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('ar_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='考试者')),
                ('questionbank', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Examination_results', verbose_name='对应的考试结果')),
                ('word', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Word', verbose_name='所考单词')),
            ],
            options={
                'verbose_name': '答题记录',
                'verbose_name_plural': '答题记录',
            },
        ),
    ]
