# Generated by Django 2.1.5 on 2019-09-16 07:44

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('orgs', '0009_organization_logo'),
        ('features', '0017_auto_20190911_1550'),
        ('designs', '0004_auto_20190916_1544'),
        ('test', '0002_auto_20190916_1130'),
    ]

    operations = [
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('prerequisites', models.TextField(blank=True, null=True, verbose_name='前置条件')),
                ('body', models.TextField(verbose_name='请求body')),
                ('expected', models.TextField(blank=True, null=True, verbose_name='预期结果')),
                ('response', models.TextField(blank=True, null=True, verbose_name='response')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'test',
            },
        ),
        migrations.CreateModel(
            name='TestAutoPlan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=128, verbose_name='名称')),
                ('time', models.CharField(max_length=64, verbose_name='时刻，1-24逗号隔开')),
                ('week', models.CharField(max_length=14, verbose_name='星期几，1-7逗号隔开')),
                ('description', models.TextField(null=True, verbose_name='描述')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'test_auto_plan',
            },
        ),
        migrations.CreateModel(
            name='TestCase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=128, verbose_name='用例名')),
                ('status', models.CharField(choices=[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3')], max_length=2, verbose_name='状态')),
                ('type', models.CharField(choices=[('0', '0'), ('1', '1')], max_length=2, verbose_name='用例类型')),
                ('level', models.CharField(choices=[('P0', 'P0'), ('P1', 'P1'), ('P2', 'P2'), ('P3', 'P3')], max_length=2, verbose_name='用例等级')),
                ('prerequisites', models.TextField(blank=True, null=True, verbose_name='前置条件')),
                ('desc', models.TextField(blank=True, null=True, verbose_name='描述')),
                ('expected', models.TextField(blank=True, null=True, verbose_name='预期结果')),
                ('created_by', models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL)),
                ('feature', models.ManyToManyField(blank=True, related_name='test_case_feature', to='features.Feature', verbose_name='归属需求')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='test_case_group', to='test.TestGroup', verbose_name='归属用例组')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='test_case_user', to=settings.AUTH_USER_MODEL, verbose_name='归属用例组')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'test_case',
            },
        ),
        migrations.CreateModel(
            name='TestPlan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=128, verbose_name='名称')),
                ('start_date', models.CharField(max_length=8, verbose_name='开始日期YYYYMMDD')),
                ('end_date', models.CharField(max_length=8, verbose_name='结束日期YYYYMMDD')),
                ('description', models.TextField(null=True, verbose_name='描述')),
                ('case', models.ManyToManyField(blank=True, related_name='test_plan_case', to='test.TestCase', verbose_name='用例')),
                ('created_by', models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL)),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='test_plan_user', to=settings.AUTH_USER_MODEL, verbose_name='负责人')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'test_plan',
            },
        ),
        migrations.AddField(
            model_name='testautoplan',
            name='case',
            field=models.ManyToManyField(blank=True, related_name='test_auto_plan_case', to='test.TestCase', verbose_name='用例'),
        ),
        migrations.AddField(
            model_name='testautoplan',
            name='created_by',
            field=models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='testautoplan',
            name='env',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='test_auto_plan_env', to='test.TestEnv', verbose_name='测试环境'),
        ),
        migrations.AddField(
            model_name='testautoplan',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization'),
        ),
        migrations.AddField(
            model_name='testautoplan',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='test_auto_plan_user', to=settings.AUTH_USER_MODEL, verbose_name='负责人'),
        ),
        migrations.AddField(
            model_name='test',
            name='case',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='test_case', to='test.TestCase', verbose_name='用例'),
        ),
        migrations.AddField(
            model_name='test',
            name='created_by',
            field=models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='test',
            name='env',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='test_env', to='test.TestEnv', verbose_name='测试环境'),
        ),
        migrations.AddField(
            model_name='test',
            name='interface',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='test_interface', to='designs.Interfaces', verbose_name='接口'),
        ),
        migrations.AddField(
            model_name='test',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization'),
        ),
        migrations.AlterUniqueTogether(
            name='testplan',
            unique_together={('name',)},
        ),
        migrations.AlterUniqueTogether(
            name='testautoplan',
            unique_together={('name',)},
        ),
        migrations.AlterUniqueTogether(
            name='test',
            unique_together={('case',)},
        ),
    ]
