# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-08 22:54
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='BudgetItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('year', models.IntegerField()),
                ('agency', models.TextField()),
                ('data_source', models.TextField()),
                ('category', models.TextField()),
                ('dollars_budgeted', models.DecimalField(decimal_places=2, max_digits=14)),
                ('dollars_spent', models.DecimalField(decimal_places=2, max_digits=14)),
                ('row_number', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Upload',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('file_metadata', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('file', models.FileField(upload_to='')),
                ('raw', models.BinaryField(null=True)),
                ('validation_results', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('status', models.CharField(choices=[('LOADING', 'Loading'), ('PENDING', 'Pending'), ('STAGED', 'Staged'), ('INSERTED', 'Inserted'), ('DELETED', 'Deleted')], default='LOADING', max_length=10)),
                ('status_changed_at', models.DateTimeField(null=True)),
                ('replaces', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replaced_by', to='budget_data_ingest.Upload')),
                ('status_changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('submitter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='budgetitem',
            name='upload',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='budget_data_ingest.Upload'),
        ),
    ]

[((357, 414), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (388, 414), False, 'from django.db import migrations, models\n'), ((2688, 2787), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""budget_data_ingest.Upload"""'}), "(on_delete=django.db.models.deletion.CASCADE, to=\n    'budget_data_ingest.Upload')\n", (2705, 2787), False, 'from django.db import migrations, models\n'), ((549, 642), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n    verbose_name='ID')\n", (565, 642), False, 'from django.db import migrations, models\n'), ((666, 687), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (685, 687), False, 'from django.db import migrations, models\n'), ((717, 735), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (733, 735), False, 'from django.db import migrations, models\n'), ((770, 788), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (786, 788), False, 'from django.db import migrations, models\n'), ((820, 838), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (836, 838), False, 'from django.db import migrations, models\n'), ((878, 930), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(2)', 'max_digits': '(14)'}), '(decimal_places=2, max_digits=14)\n', (897, 930), False, 'from django.db import migrations, models\n'), ((967, 1019), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(2)', 'max_digits': '(14)'}), '(decimal_places=2, max_digits=14)\n', (986, 1019), False, 'from django.db import migrations, models\n'), ((1053, 1074), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (1072, 1074), False, 'from django.db import migrations, models\n'), ((1206, 1299), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n    verbose_name='ID')\n", (1222, 1299), False, 'from django.db import migrations, models\n'), ((1329, 1368), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (1349, 1368), False, 'from django.db import migrations, models\n'), ((1402, 1437), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now': '(True)'}), '(auto_now=True)\n', (1422, 1437), False, 'from django.db import migrations, models\n'), ((1559, 1589), 'django.db.models.FileField', 'models.FileField', ([], {'upload_to': '""""""'}), "(upload_to='')\n", (1575, 1589), False, 'from django.db import migrations, models\n'), ((1616, 1645), 'django.db.models.BinaryField', 'models.BinaryField', ([], {'null': '(True)'}), '(null=True)\n', (1634, 1645), False, 'from django.db import migrations, models\n'), ((1774, 1963), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('LOADING', 'Loading'), ('PENDING', 'Pending'), ('STAGED', 'Staged'), (\n    'INSERTED', 'Inserted'), ('DELETED', 'Deleted')]", 'default': '"""LOADING"""', 'max_length': '(10)'}), "(choices=[('LOADING', 'Loading'), ('PENDING', 'Pending'), (\n    'STAGED', 'Staged'), ('INSERTED', 'Inserted'), ('DELETED', 'Deleted')],\n    default='LOADING', max_length=10)\n", (1790, 1963), False, 'from django.db import migrations, models\n'), ((1995, 2026), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'null': '(True)'}), '(null=True)\n', (2015, 2026), False, 'from django.db import migrations, models\n'), ((2058, 2195), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""replaced_by"""', 'to': '"""budget_data_ingest.Upload"""'}), "(null=True, on_delete=django.db.models.deletion.CASCADE,\n    related_name='replaced_by', to='budget_data_ingest.Upload')\n", (2075, 2195), False, 'from django.db import migrations, models\n'), ((2232, 2356), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""+"""', 'to': 'settings.AUTH_USER_MODEL'}), "(null=True, on_delete=django.db.models.deletion.CASCADE,\n    related_name='+', to=settings.AUTH_USER_MODEL)\n", (2249, 2356), False, 'from django.db import migrations, models\n'), ((2385, 2481), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'to': 'settings.AUTH_USER_MODEL'}), '(on_delete=django.db.models.deletion.CASCADE, to=settings.\n    AUTH_USER_MODEL)\n', (2402, 2481), False, 'from django.db import migrations, models\n')]