# Generated by Django 2.1.5 on 2019-04-17 23:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('orgs', '0005_auto_20190418_0728'),
        ('applications', '0005_appspec_dependency'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Feature',
            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)),
                ('title', models.CharField(max_length=128, verbose_name='标题')),
                ('description', models.TextField(null=True, verbose_name='描述')),
                ('start_date', models.DateTimeField()),
                ('end_date', models.DateTimeField()),
                ('important', models.IntegerField(verbose_name='重要性')),
                ('priority', models.IntegerField(verbose_name='优先级')),
                ('estimate_time', models.IntegerField(verbose_name='时间预估')),
                ('progress', models.IntegerField(verbose_name='进度')),
                ('status', models.CharField(choices=[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5')], max_length=2)),
                ('closed_at', models.DateTimeField(null=True, verbose_name='关闭时间')),
            ],
            options={
                'verbose_name': '业务需求表',
                'db_table': 'features',
            },
        ),
        migrations.CreateModel(
            name='FeatureBranch',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('feature', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='feature_branch', serialize=False, to='features.Feature', verbose_name='分支关联需求')),
                ('branch_name', models.CharField(max_length=128)),
                ('ref', models.CharField(max_length=128)),
                ('status', models.CharField(max_length=2)),
            ],
            options={
                'verbose_name': '需求分支表',
                'db_table': 'feature_branchs',
            },
        ),
        migrations.AddField(
            model_name='feature',
            name='application',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='app_features', to='applications.Application', verbose_name='关联应用'),
        ),
        migrations.AddField(
            model_name='feature',
            name='closed_by',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='close_features', to=settings.AUTH_USER_MODEL, verbose_name='关闭人'),
        ),
        migrations.AddField(
            model_name='feature',
            name='created_by',
            field=models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='feature',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization'),
        ),
        migrations.AddField(
            model_name='feature',
            name='owner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='own_features', to=settings.AUTH_USER_MODEL, verbose_name='责任人'),
        ),
    ]
