# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2017-01-19 23:38
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
        ('templateuri', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('documents', '0009_document_stale_on'),
    ]

    operations = [
        migrations.CreateModel(
            name='FluxInstance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now)),
                ('status', models.IntegerField(choices=[(0, 'Pending'), (1, 'Accepted'), (2, 'Rejected')], default=0)),
                ('accepted_by', models.ManyToManyField(blank=True, default=None, related_name='accepted_flux', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='FluxModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(default='flux_name', max_length=100)),
                ('days_until_stale', models.IntegerField(default=30)),
                ('acceptance_criteria', models.ManyToManyField(blank=True, related_name='flux_models', to=settings.AUTH_USER_MODEL)),
                ('groups', models.ManyToManyField(related_name='visible_flux', to='auth.Group')),
            ],
        ),
        migrations.CreateModel(
            name='Step',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='step_name', max_length=100)),
                ('document', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='document_step_fluxes', to='documents.Document')),
                ('template_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='template_step_fluxes', to='templateuri.Template')),
            ],
        ),
        migrations.AddField(
            model_name='fluxmodel',
            name='steps',
            field=models.ManyToManyField(related_name='in_model_fluxes', to='documents.Step'),
        ),
        migrations.AddField(
            model_name='fluxinstance',
            name='flux_parent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='instances', to='documents.FluxModel'),
        ),
        migrations.AddField(
            model_name='fluxinstance',
            name='initiated_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='fluxinstance',
            name='steps',
            field=models.ManyToManyField(blank=True, default=None, related_name='in_instance_fluxes', to='documents.Step'),
        ),
    ]
