# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-08-26 04:15
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('aims', '0044_iati_to_aims_create'),
    ]

    drop_indexes = [
        migrations.RunSQL('ALTER TABLE public.oldaims_activity DROP CONSTRAINT IF EXISTS aims_activity_pkey;'),
        migrations.RunSQL('DROP INDEX IF EXISTS public.aims_activity_pkey CASCADE;'),
        migrations.RunSQL('DROP INDEX IF EXISTS public.aims_activity_bf980b08 CASCADE;'),
        migrations.RunSQL('DROP INDEX IF EXISTS public.aims_activity_total_commitment_currency_id_4cf27d13_like CASCADE;'),
        migrations.RunSQL('DROP INDEX IF EXISTS public.aims_activity_total_commitment_currency_id_4cf27d13 CASCADE;'),
        migrations.RunSQL('DROP INDEX IF EXISTS public.aims_location_d266de13 CASCADE;'),
        migrations.RunSQL('DROP INDEX IF EXISTS public.aims_location_area_id_47ee481b CASCADE;'),

    ]
    add_fields = [
        migrations.AddField(
            model_name='activity',
            name='completion',
            field=models.FloatField(null=True),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='date_created',
            field=models.DateField(blank=True, null=True, verbose_name='Date Created'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='date_modified',
            field=models.DateField(blank=True, null=True, verbose_name='Last Modified'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='openly_status',
            field=models.CharField(choices=[('iatixml', 'IATI XML'), ('draft', 'Draft'), ('published', 'Published'),
                                            ('archived', 'Archived'), ('blank', 'Blank'), ('review', 'Under review')],
                                   default='iatixml', max_length=12),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='participating_organisation',
            field=models.ManyToManyField(through='aims.ActivityParticipatingOrganisation', to='aims.Organisation'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='policy_marker',
            field=models.ManyToManyField(through='aims.ActivityPolicyMarker', to='aims.PolicyMarker'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='recipient_country',
            field=models.ManyToManyField(through='aims.ActivityRecipientCountry', to='geodata.Country'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='recipient_region',
            field=models.ManyToManyField(through='aims.ActivityRecipientRegion', to='geodata.Region'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='sector',
            field=models.ManyToManyField(through='aims.ActivitySector', to='aims.Sector'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='total_commitment',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=15),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='total_commitment_currency',
            field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE,
                                    to='aims.Currency'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='activity',
            name='total_commitment_usd',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=15),
            preserve_default=True,
        ),
        migrations.AddField(
            'location',
            'area',
            models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='area_activities', to='simple_locations.Area')
        )
    ]

    operations = [
        *drop_indexes,
        *add_fields
    ]
