# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-08-18 00:25
from __future__ import unicode_literals

import autoslug.fields
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import smart_selects.db_fields


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('django_project', '0018_auto_20160811_0814'),
    ]

    operations = [
        migrations.CreateModel(
            name='Milestone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('slug', autoslug.fields.AutoSlugField(always_update=True, editable=False, max_length=64, populate_from=b'name', unique_with=(b'project',))),
                ('description', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified at')),
                ('deadline', models.DateField(default=datetime.date(2016, 8, 28), verbose_name='deadline')),
                ('date_completed', models.DateField(blank=True, null=True, verbose_name='date completed')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='author')),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_project.Project', verbose_name='project')),
            ],
            options={
                'ordering': ('created_at',),
                'verbose_name': 'milestone',
                'verbose_name_plural': 'milestones',
            },
        ),
        migrations.RemoveField(
            model_name='assignedresource_relation',
            name='role',
        ),
        migrations.RemoveField(
            model_name='assignedresource_relation',
            name='task',
        ),
        migrations.RemoveField(
            model_name='assignedresource_relation',
            name='user',
        ),
        migrations.RemoveField(
            model_name='mediaupload',
            name='project',
        ),
        migrations.RemoveField(
            model_name='profile',
            name='user',
        ),
        migrations.RemoveField(
            model_name='role',
            name='project',
        ),
        migrations.RemoveField(
            model_name='task',
            name='can_write',
        ),
        migrations.RemoveField(
            model_name='task',
            name='collapsed',
        ),
        migrations.RemoveField(
            model_name='task',
            name='depends',
        ),
        migrations.RemoveField(
            model_name='task',
            name='end',
        ),
        migrations.RemoveField(
            model_name='task',
            name='end_is_milestone',
        ),
        migrations.RemoveField(
            model_name='task',
            name='has_child',
        ),
        migrations.RemoveField(
            model_name='task',
            name='level',
        ),
        migrations.RemoveField(
            model_name='task',
            name='name',
        ),
        migrations.RemoveField(
            model_name='task',
            name='short_name',
        ),
        migrations.RemoveField(
            model_name='task',
            name='start',
        ),
        migrations.RemoveField(
            model_name='task',
            name='start_is_milestone',
        ),
        migrations.AddField(
            model_name='task',
            name='deadline',
            field=models.DateField(blank=True, help_text=b'YYYY-MM-DD', null=True, verbose_name='deadline'),
        ),
        migrations.AlterField(
            model_name='task',
            name='status',
            field=smart_selects.db_fields.ChainedForeignKey(chained_field=b'project', chained_model_field=b'project', on_delete=django.db.models.deletion.CASCADE, to='django_project.Status', verbose_name='status'),
        ),
        migrations.DeleteModel(
            name='AssignedResource_Relation',
        ),
        migrations.DeleteModel(
            name='MediaUpload',
        ),
        migrations.DeleteModel(
            name='Profile',
        ),
        migrations.DeleteModel(
            name='Role',
        ),
        migrations.AddField(
            model_name='task',
            name='milestone',
            field=smart_selects.db_fields.ChainedForeignKey(blank=True, chained_field=b'project', chained_model_field=b'project', null=True, on_delete=django.db.models.deletion.CASCADE, to='django_project.Milestone', verbose_name='milestone'),
        ),
        migrations.AlterUniqueTogether(
            name='milestone',
            unique_together=set([('project', 'name')]),
        ),
    ]
