# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-28 20:13
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import smart_selects.db_fields


class Migration(migrations.Migration):

    dependencies = [
        ('acquisitions', '0010_merge'),
    ]

    operations = [
        migrations.CreateModel(
            name='Actor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Stage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Step',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveIntegerField(db_index=True, editable=False)),
                ('actor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='acquisitions.Actor')),
                ('stage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='acquisitions.Stage')),
            ],
            options={
                'ordering': ('order',),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='StepTrackThroughModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveIntegerField(db_index=True, editable=False)),
                ('step', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='acquisitions.Step')),
                ('track', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='acquisitions.Track')),
            ],
            options={
                'ordering': ('track', 'order'),
            },
        ),
        migrations.RemoveField(
            model_name='awardstatus',
            name='is_before',
        ),
        migrations.RemoveField(
            model_name='awardstatus',
            name='track',
        ),
        migrations.RemoveField(
            model_name='acquisition',
            name='award_status',
        ),
        migrations.AlterField(
            model_name='acquisition',
            name='track',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='acquisition_track', to='acquisitions.Track'),
        ),
        migrations.DeleteModel(
            name='AwardStatus',
        ),
        migrations.AddField(
            model_name='step',
            name='track',
            field=models.ManyToManyField(through='acquisitions.StepTrackThroughModel', to='acquisitions.Track'),
        ),
        migrations.AddField(
            model_name='acquisition',
            name='stage',
            field=smart_selects.db_fields.ChainedForeignKey(chained_field='track', chained_model_field='track', default=0, on_delete=django.db.models.deletion.CASCADE, to='acquisitions.Stage'),
        ),
        migrations.AddField(
            model_name='acquisition',
            name='step',
            field=smart_selects.db_fields.ChainedForeignKey(chained_field='stage', chained_model_field='stage', default=0, on_delete=django.db.models.deletion.CASCADE, to='acquisitions.Step'),
        ),
    ]
