<reponame>desafinadude/municipal-data
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-11-13 09:57
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('municipal_finance', '0012_mediangroup_ratingcountgroup'),
    ]

    operations = [
        migrations.CreateModel(
            name='AmountTypeV2',
            fields=[
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
                ('label', models.TextField()),
            ],
            options={
                'db_table': 'amount_type_v2',
            },
        ),
        migrations.CreateModel(
            name='BsheetFactsV2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('demarcation_code', models.TextField()),
                ('period_code', models.TextField()),
                ('amount', models.BigIntegerField(null=True)),
                ('financial_year', models.IntegerField()),
                ('period_length', models.TextField()),
                ('financial_period', models.IntegerField()),
                ('amount_type', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.AmountTypeV2')),
            ],
            options={
                'db_table': 'bsheet_facts_v2',
            },
        ),
        migrations.CreateModel(
            name='BsheetItemsV2',
            fields=[
                ('label', models.TextField()),
                ('position_in_return_form', models.IntegerField(null=True)),
                ('return_form_structure', models.TextField(null=True)),
                ('composition', models.TextField(null=True)),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'bsheet_items_v2',
            },
        ),
        migrations.CreateModel(
            name='CflowFactsV2',
            fields=[
                ('demarcation_code', models.TextField()),
                ('period_code', models.TextField()),
                ('amount', models.BigIntegerField(null=True)),
                ('financial_year', models.IntegerField()),
                ('period_length', models.TextField()),
                ('financial_period', models.IntegerField()),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('amount_type', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.AmountTypeV2')),
            ],
            options={
                'db_table': 'cflow_facts_v2',
            },
        ),
        migrations.CreateModel(
            name='CflowItemsV2',
            fields=[
                ('label', models.TextField()),
                ('position_in_return_form', models.IntegerField(null=True)),
                ('return_form_structure', models.TextField(null=True)),
                ('composition', models.TextField(null=True)),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'cflow_items_v2',
            },
        ),
        migrations.CreateModel(
            name='GovernmentFunctionsV2',
            fields=[
                ('label', models.TextField()),
                ('category_label', models.TextField()),
                ('subcategory_label', models.TextField()),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'government_functions_v2',
            },
        ),
        migrations.CreateModel(
            name='IncexpFactsV2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('demarcation_code', models.TextField()),
                ('period_code', models.TextField()),
                ('amount', models.BigIntegerField(null=True)),
                ('financial_year', models.IntegerField()),
                ('period_length', models.TextField()),
                ('financial_period', models.IntegerField()),
                ('amount_type', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.AmountTypeV2')),
                ('function', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.GovernmentFunctionsV2')),
            ],
            options={
                'db_table': 'incexp_facts_v2',
            },
        ),
        migrations.CreateModel(
            name='IncexpItemsV2',
            fields=[
                ('label', models.TextField()),
                ('position_in_return_form', models.IntegerField(null=True)),
                ('return_form_structure', models.TextField(null=True)),
                ('composition', models.TextField(null=True)),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'incexp_items_v2',
            },
        ),
        migrations.RenameModel(
            old_name='BsheetFacts',
            new_name='BsheetFactsV1',
        ),
        migrations.RenameModel(
            old_name='BsheetItems',
            new_name='BsheetItemsV1',
        ),
        migrations.RenameModel(
            old_name='CflowFacts',
            new_name='CflowFactsV1',
        ),
        migrations.RenameModel(
            old_name='CflowItems',
            new_name='CflowItemsV1',
        ),
        migrations.RenameModel(
            old_name='GovernmentFunctions',
            new_name='GovernmentFunctionsV1',
        ),
        migrations.RenameModel(
            old_name='IncexpFacts',
            new_name='IncexpFactsV1',
        ),
        migrations.RenameModel(
            old_name='IncexpItems',
            new_name='IncexpItemsV1',
        ),
        migrations.AddField(
            model_name='incexpfactsv2',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.IncexpItemsV2'),
        ),
        migrations.AddField(
            model_name='cflowfactsv2',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.CflowItemsV2'),
        ),
        migrations.AddField(
            model_name='bsheetfactsv2',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.BsheetItemsV2'),
        ),
        migrations.AlterUniqueTogether(
            name='incexpfactsv2',
            unique_together=set([('amount_type', 'demarcation_code', 'financial_period', 'financial_year', 'function', 'item', 'period_length'), ('demarcation_code', 'period_code', 'function', 'item')]),
        ),
        migrations.AlterUniqueTogether(
            name='cflowfactsv2',
            unique_together=set([('demarcation_code', 'period_code', 'item'), ('amount_type', 'demarcation_code', 'financial_period', 'financial_year', 'item', 'period_length')]),
        ),
        migrations.AlterUniqueTogether(
            name='bsheetfactsv2',
            unique_together=set([('demarcation_code', 'period_code', 'item'), ('amount_type', 'demarcation_code', 'financial_period', 'financial_year', 'item', 'period_length')]),
        ),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-11-13 09:57
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('municipal_finance', '0012_mediangroup_ratingcountgroup'),
    ]

    operations = [
        migrations.CreateModel(
            name='AmountTypeV2',
            fields=[
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
                ('label', models.TextField()),
            ],
            options={
                'db_table': 'amount_type_v2',
            },
        ),
        migrations.CreateModel(
            name='BsheetFactsV2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('demarcation_code', models.TextField()),
                ('period_code', models.TextField()),
                ('amount', models.BigIntegerField(null=True)),
                ('financial_year', models.IntegerField()),
                ('period_length', models.TextField()),
                ('financial_period', models.IntegerField()),
                ('amount_type', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.AmountTypeV2')),
            ],
            options={
                'db_table': 'bsheet_facts_v2',
            },
        ),
        migrations.CreateModel(
            name='BsheetItemsV2',
            fields=[
                ('label', models.TextField()),
                ('position_in_return_form', models.IntegerField(null=True)),
                ('return_form_structure', models.TextField(null=True)),
                ('composition', models.TextField(null=True)),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'bsheet_items_v2',
            },
        ),
        migrations.CreateModel(
            name='CflowFactsV2',
            fields=[
                ('demarcation_code', models.TextField()),
                ('period_code', models.TextField()),
                ('amount', models.BigIntegerField(null=True)),
                ('financial_year', models.IntegerField()),
                ('period_length', models.TextField()),
                ('financial_period', models.IntegerField()),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('amount_type', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.AmountTypeV2')),
            ],
            options={
                'db_table': 'cflow_facts_v2',
            },
        ),
        migrations.CreateModel(
            name='CflowItemsV2',
            fields=[
                ('label', models.TextField()),
                ('position_in_return_form', models.IntegerField(null=True)),
                ('return_form_structure', models.TextField(null=True)),
                ('composition', models.TextField(null=True)),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'cflow_items_v2',
            },
        ),
        migrations.CreateModel(
            name='GovernmentFunctionsV2',
            fields=[
                ('label', models.TextField()),
                ('category_label', models.TextField()),
                ('subcategory_label', models.TextField()),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'government_functions_v2',
            },
        ),
        migrations.CreateModel(
            name='IncexpFactsV2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('demarcation_code', models.TextField()),
                ('period_code', models.TextField()),
                ('amount', models.BigIntegerField(null=True)),
                ('financial_year', models.IntegerField()),
                ('period_length', models.TextField()),
                ('financial_period', models.IntegerField()),
                ('amount_type', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.AmountTypeV2')),
                ('function', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.GovernmentFunctionsV2')),
            ],
            options={
                'db_table': 'incexp_facts_v2',
            },
        ),
        migrations.CreateModel(
            name='IncexpItemsV2',
            fields=[
                ('label', models.TextField()),
                ('position_in_return_form', models.IntegerField(null=True)),
                ('return_form_structure', models.TextField(null=True)),
                ('composition', models.TextField(null=True)),
                ('id', municipal_finance.models.small_auto_field.SmallAutoField(primary_key=True, serialize=False)),
                ('code', models.TextField(unique=True)),
            ],
            options={
                'db_table': 'incexp_items_v2',
            },
        ),
        migrations.RenameModel(
            old_name='BsheetFacts',
            new_name='BsheetFactsV1',
        ),
        migrations.RenameModel(
            old_name='BsheetItems',
            new_name='BsheetItemsV1',
        ),
        migrations.RenameModel(
            old_name='CflowFacts',
            new_name='CflowFactsV1',
        ),
        migrations.RenameModel(
            old_name='CflowItems',
            new_name='CflowItemsV1',
        ),
        migrations.RenameModel(
            old_name='GovernmentFunctions',
            new_name='GovernmentFunctionsV1',
        ),
        migrations.RenameModel(
            old_name='IncexpFacts',
            new_name='IncexpFactsV1',
        ),
        migrations.RenameModel(
            old_name='IncexpItems',
            new_name='IncexpItemsV1',
        ),
        migrations.AddField(
            model_name='incexpfactsv2',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.IncexpItemsV2'),
        ),
        migrations.AddField(
            model_name='cflowfactsv2',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.CflowItemsV2'),
        ),
        migrations.AddField(
            model_name='bsheetfactsv2',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='municipal_finance.BsheetItemsV2'),
        ),
        migrations.AlterUniqueTogether(
            name='incexpfactsv2',
            unique_together=set([('amount_type', 'demarcation_code', 'financial_period', 'financial_year', 'function', 'item', 'period_length'), ('demarcation_code', 'period_code', 'function', 'item')]),
        ),
        migrations.AlterUniqueTogether(
            name='cflowfactsv2',
            unique_together=set([('demarcation_code', 'period_code', 'item'), ('amount_type', 'demarcation_code', 'financial_period', 'financial_year', 'item', 'period_length')]),
        ),
        migrations.AlterUniqueTogether(
            name='bsheetfactsv2',
            unique_together=set([('demarcation_code', 'period_code', 'item'), ('amount_type', 'demarcation_code', 'financial_period', 'financial_year', 'item', 'period_length')]),
        ),
    ]
# -*- coding: utf-8 -*- # Generated by Django 1.11.28 on 2020-11-13 09:57