# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2019-03-06 14:42
from __future__ import unicode_literals

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', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            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=30, 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')),
                ('role', models.CharField(blank=True, max_length=100)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('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': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Bug',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('bug_type', models.CharField(blank=True, choices=[('frontbug', '前端bug'), ('backbug', '后台bug'), ('appbug', '移动端bug')], max_length=20, null=True)),
                ('content', models.TextField(blank=True, null=True)),
                ('status', models.CharField(blank=True, choices=[('no_solve', '未修复'), ('solve', '已修复'), ('noneed_solve', '无需修复')], max_length=20, null=True)),
                ('level', models.CharField(blank=True, choices=[('blocker', '崩溃'), ('critical', '严重'), ('major', '一般'), ('minor', '次要')], max_length=10, null=True)),
            ],
            options={
                'verbose_name': 'bug表',
                'verbose_name_plural': 'bug表',
            },
        ),
        migrations.CreateModel(
            name='Build',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('site', models.CharField(blank=True, max_length=200, null=True)),
            ],
            options={
                'verbose_name': '测试版本/链接',
                'verbose_name_plural': '测试版本/链接',
            },
        ),
        migrations.CreateModel(
            name='Case',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('case_type', models.CharField(blank=True, choices=[('link', '链接'), ('file', '文件')], max_length=10, null=True)),
                ('content', models.CharField(blank=True, max_length=200, null=True)),
            ],
            options={
                'verbose_name': '测试用例',
                'verbose_name_plural': '测试用例',
            },
        ),
        migrations.CreateModel(
            name='Compat',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('compat_type', models.CharField(blank=True, choices=[('computer', '电脑'), ('browser', '浏览器'), ('phone', '手机')], max_length=10, null=True)),
                ('system', models.CharField(blank=True, max_length=30, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Config',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('content', models.TextField(blank=True, null=True)),
            ],
            options={
                'verbose_name': '测试配置',
                'verbose_name_plural': '测试配置',
            },
        ),
        migrations.CreateModel(
            name='Demand',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('status', models.CharField(choices=[('no_summit', '未提测'), ('summit', '已提测'), ('completed', '已完成')], max_length=10)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('summit_test_time', models.DateTimeField(blank=True, null=True)),
                ('finish_time', models.DateTimeField(blank=True, null=True)),
            ],
            options={
                'verbose_name': '需求',
                'verbose_name_plural': '需求',
            },
        ),
        migrations.CreateModel(
            name='Developer',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('password', models.CharField(max_length=40)),
                ('role', models.CharField(choices=[('web', '前端'), ('background', '后台'), ('app', '移动端'), ('tester', '测试'), ('product', '产品')], max_length=20)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('update_time', models.DateTimeField(auto_now=True, null=True)),
                ('demand', models.ManyToManyField(related_name='developer', to='report.Demand')),
            ],
            options={
                'verbose_name': '用户信息表',
                'verbose_name_plural': '用户信息表',
            },
        ),
        migrations.CreateModel(
            name='Remain',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('content', models.TextField(blank=True, null=True)),
            ],
            options={
                'verbose_name': '遗留问题',
                'verbose_name_plural': '遗留问题',
            },
        ),
        migrations.CreateModel(
            name='Report',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('report_type', models.CharField(choices=[('pc', 'PC端报告'), ('app', '移动端报告')], default='pc', max_length=10)),
                ('result', models.CharField(choices=[('pass', '测试通过'), ('block', '测试不通过'), ('finish', '测试完成')], max_length=10)),
                ('env', models.CharField(choices=[('formal', '正式环境'), ('test', '测试环境'), ('gray', '灰度环境')], max_length=10)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('start_time', models.DateTimeField(blank=True, null=True)),
                ('end_time', models.DateTimeField(blank=True, null=True)),
                ('demand', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='report.Demand')),
                ('developer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='report.Developer')),
            ],
            options={
                'verbose_name': '测试报告',
                'verbose_name_plural': '测试报告',
            },
        ),
        migrations.AddField(
            model_name='remain',
            name='report',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='remain', to='report.Report'),
        ),
        migrations.AddField(
            model_name='config',
            name='report',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='config', to='report.Report'),
        ),
        migrations.AddField(
            model_name='compat',
            name='report',
            field=models.ManyToManyField(related_name='compat', to='report.Report'),
        ),
        migrations.AddField(
            model_name='case',
            name='report',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='case', to='report.Report'),
        ),
        migrations.AddField(
            model_name='build',
            name='report',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='build', to='report.Report'),
        ),
        migrations.AddField(
            model_name='bug',
            name='demand',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bug', to='report.Demand'),
        ),
    ]
