# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-09 05:32
from __future__ import unicode_literals

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


def create_initial_budget_status(apps, *args):
    BudgetStatus = apps.get_model('iati', 'BudgetStatus')
    BudgetStatus.objects.create(code=1, name='Indicative')
    BudgetStatus.objects.create(code=2, name='Committed')


class Migration(migrations.Migration):

    dependencies = [
        ('iati', '0011_auto_20170418_1526'),
    ]

    operations = [
        migrations.CreateModel(
            name='BudgetStatus',
            fields=[
                ('code', models.SmallIntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=20)),
            ],
        ),
        migrations.RunPython(create_initial_budget_status, reverse_code=migrations.RunPython.noop),
        migrations.AddField(
            model_name='budget',
            name='status',
            field=models.ForeignKey(null=False, default=1, on_delete=django.db.models.deletion.CASCADE, to='iati.BudgetStatus'),
        ),
    ]
