# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-10-11 22:48
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('projects', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('milestone', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='SubType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120, verbose_name='name')),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'SubType',
                'verbose_name_plural': 'SubTypes',
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120, verbose_name='Task Name')),
                ('start_date', models.DateField(blank=True, null=True, verbose_name='Start Date')),
                ('end_date', models.DateField(blank=True, null=True, verbose_name='End Date')),
                ('created_at', models.DateTimeField(default=datetime.datetime.now, editable=False, verbose_name='created at')),
                ('status', models.CharField(choices=[(b'open', 'open'), (b'closed', 'closed'), (b'hold', 'hold'), (b'Unreviewed', 'Unreviewed'), (b'Design decision needed', 'Design decision needed'), (b'Accepted', 'Accepted'), (b'Ready for checkin', 'Ready for checkin'), (b'Fixed on a branch', 'Fixed on a branch')], max_length=120, null=True)),
                ('priority', models.CharField(choices=[(b'blocker', 'blocker'), (b'critical', 'critical'), (b'major', 'major'), (b'minor', 'minor'), (b'trivial', 'trivial')], max_length=120, null=True)),
                ('notes', models.TextField(blank=True, null=True, verbose_name='Description')),
                ('share_to_all', models.BooleanField(default=False, verbose_name='Share Task')),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('assigned_resources', models.ManyToManyField(to=settings.AUTH_USER_MODEL, verbose_name='Assigned Resources')),
                ('author', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='created_task', to=settings.AUTH_USER_MODEL, verbose_name='author')),
                ('editor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tasks_task_user', to=settings.AUTH_USER_MODEL, verbose_name='editor')),
                ('milestone', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='milestone.Milestone', verbose_name='milestone')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owned_task', to=settings.AUTH_USER_MODEL, verbose_name='owner')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tasks_task_parent', to='tasks.Task', verbose_name='Module')),
                ('project', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='projects.Project', verbose_name='project')),
                ('sub_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='tasks.SubType', verbose_name='Task Sub Type')),
            ],
            options={
                'ordering': ['-created_at'],
                'verbose_name': 'Task',
                'verbose_name_plural': 'Tasks',
            },
        ),
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120, verbose_name='name')),
                ('is_project_type', models.BooleanField(default=True, verbose_name='is_project_type')),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'Type',
                'verbose_name_plural': 'Types',
            },
        ),
        migrations.AddField(
            model_name='task',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasks.Type', verbose_name='Task Type'),
        ),
        migrations.AddField(
            model_name='subtype',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasks.Type', verbose_name='type'),
        ),
    ]
