# Generated by Django 3.1.13 on 2021-08-18 05:13

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


class Migration(migrations.Migration):

    dependencies = [
        ('barriers', '0109_publicbarrierlighttouchreviews_enabled'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('action_plans', '0011_actionplantask_progress'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalActionPlanTask',
            fields=[
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4)),
                ('status', models.CharField(blank=True, choices=[('NOT_STARTED', 'Not started'), ('IN_PROGRESS', 'In progress'), ('COMPLETED', 'Completed')], default='NOT_STARTED', max_length=100)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('completion_date', models.DateField(blank=True, null=True)),
                ('action_text', models.TextField()),
                ('action_type', models.CharField(choices=[('SCOPING_AND_RESEARCH', 'Scoping/Research'), ('LOBBYING', 'Lobbying'), ('UNILATERAL_INTERVENTIONS', 'Unilateral interventions'), ('BILATERAL_ENGAGEMENT', 'Bilateral engagement'), ('PLURILATERAL_ENGAGEMENT', 'Plurilateral engagement'), ('MULTILATERAL_ENGAGEMENT', 'Multilateral engagement'), ('EVENT', 'Event'), ('WHITEHALL_FUNDING_STREAMS', 'Whitehall funding streams'), ('RESOLUTION_NOT_LEAD_BY_DIT', 'Resolution not lead by DIT'), ('OTHER', 'Other')], max_length=100)),
                ('action_type_category', models.CharField(blank=True, default='Other', max_length=100, null=True)),
                ('stakeholders', models.TextField(blank=True, default='')),
                ('outcome', models.TextField(blank=True, default='')),
                ('progress', models.TextField(blank=True, default='')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('assigned_to', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('milestone', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='action_plans.actionplanmilestone')),
            ],
            options={
                'verbose_name': 'historical action plan task',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalActionPlanMilestone',
            fields=[
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4)),
                ('objective', models.TextField()),
                ('completion_date', models.DateField(blank=True, null=True)),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('action_plan', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='action_plans.actionplan')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical action plan milestone',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalActionPlan',
            fields=[
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4)),
                ('current_status', models.TextField(blank=True, default='')),
                ('current_status_last_updated', models.DateTimeField(blank=True, null=True)),
                ('status', models.CharField(blank=True, choices=[('ON_TRACK', 'On track'), ('RISK_OF_DELAY', 'Risk of delay'), ('DELAYED', 'Delayed')], max_length=100, null=True)),
                ('strategic_context', models.TextField(blank=True, default='')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('barrier', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='barriers.barrier')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('owner', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical action plan',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
