# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-24
from __future__ import unicode_literals
from corehq.sql_db.operations import RawSQLMigration
from django.db import migrations
from custom.icds_reports.utils.migrations import get_view_migrations


migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates', 'database_views'))


class Migration(migrations.Migration):

    dependencies = [
        ('icds_reports', '0159_update_agg_awc_monthly_view_visit_fields'),
    ]

    operations = [
        migrations.RunSQL('ALTER TABLE child_health_monthly ADD COLUMN opened_on TIMESTAMP'),
        migrations.RunSQL('ALTER TABLE agg_child_health ADD COLUMN open_all_created_in_month INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_child_health ADD COLUMN valid_all_created_in_month INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_3_6_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_3_6_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_3_6_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_3_6_male INTEGER'),

        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_3_6_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_3_6_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_3_6_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_3_6_female INTEGER'),
        migrator.get_migration('agg_awc_monthly.sql')
    ]


# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-24
from __future__ import unicode_literals
from corehq.sql_db.operations import RawSQLMigration
from django.db import migrations
from custom.icds_reports.utils.migrations import get_view_migrations


migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates', 'database_views'))


class Migration(migrations.Migration):

    dependencies = [
        ('icds_reports', '0159_update_agg_awc_monthly_view_visit_fields'),
    ]

    operations = [
        migrations.RunSQL('ALTER TABLE child_health_monthly ADD COLUMN opened_on DATE'),
        migrations.RunSQL('ALTER TABLE agg_child_health ADD COLUMN open_all_created_in_month INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_child_health ADD COLUMN valid_all_created_in_month INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_3_6_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_all_3_6_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_3_6_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_all_3_6_male INTEGER'),

        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_0_3_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_0_3_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_3_6_female INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN valid_reg_in_month_3_6_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_3_6_male INTEGER'),
        migrations.RunSQL('ALTER TABLE agg_awc ADD COLUMN open_reg_in_month_3_6_female INTEGER'),
        migrator.get_migration('agg_awc_monthly.sql')
    ]


change column type