class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0157_updated_unique_constraint'), ] operations = [ migrations.RunSQL( 'ALTER TABLE agg_ccs_record ADD COLUMN lactating_all_registered_in_month INTEGER' ), migrations.RunSQL( 'ALTER TABLE agg_ccs_record ADD COLUMN pregnant_all_registered_in_month INTEGER' ), migrations.RunSQL( 'ALTER TABLE agg_ccs_record ADD COLUMN lactating_registered_in_month INTEGER' ), migrations.RunSQL( 'ALTER TABLE agg_ccs_record ADD COLUMN pregnant_registered_in_month INTEGER' ), migrations.RunSQL( 'ALTER TABLE agg_awc ADD COLUMN cases_ccs_lactating_all_reg_in_month INTEGER' ), migrations.RunSQL( 'ALTER TABLE agg_awc ADD COLUMN cases_ccs_pregnant_all_reg_in_month INTEGER' ), migrations.RunSQL( 'ALTER TABLE agg_awc ADD COLUMN cases_ccs_lactating_reg_in_month INTEGER' ), migrations.RunSQL( 'ALTER TABLE agg_awc ADD COLUMN cases_ccs_pregnant_reg_in_month INTEGER' ), ] operations.extend(get_view_migrations())
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0170_auto_20200210_1142'), ] operations = [ migrations.AddField( model_name='aggservicedeliveryreport', name='children_0_3', field=models.IntegerField(null=True), ), migrations.AddField( model_name='aggservicedeliveryreport', name='children_3_5', field=models.IntegerField(null=True), ), migrations.AddField( model_name='aggservicedeliveryreport', name='gm_0_3', field=models.IntegerField(null=True), ), migrations.AddField( model_name='aggservicedeliveryreport', name='gm_3_5', field=models.IntegerField(null=True), ) ] operations.extend(get_view_migrations())
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0088_child_name'), ] operations = get_view_migrations()
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0198_update_sdd_view'), ] operations = get_view_migrations()
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0123_weighing_new_columng_agg_awc'), ] operations = get_view_migrations()
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0174_bihar_api_model'), ] operations = get_view_migrations()
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0186_refresh_views'), ] operations = get_view_migrations()
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0187_chm_view_growth_tracker'), ] operations = get_view_migrations()
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0219_removed_unused_cols_from_sdr'), ] operations = get_view_migrations()
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0108_child_cases_ccs_record_supervisor_id'), ] operations = get_view_migrations() operations.append(migrator.get_migration('update_tables45.sql'))
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0103_aggregateccsrecordcomplementaryfeedingforms_supervisor_id'), ] operations = [ migrator.get_migration('update_tables44.sql'), ] operations.extend(get_view_migrations())
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0160_drop_like_indices'), ] operations = [ migrations.RunSQL( 'ALTER TABLE child_health_monthly ADD COLUMN opened_on DATE') ] operations.extend(get_view_migrations())
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0096_valid_visits'), ] operations = [ migrations.AddField( model_name='awwincentivereport', name='district_id', field=models.TextField(blank=True, null=True), ), ] operations.extend(get_view_migrations())
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0182_auto_20200417_0926'), ] operations = [ migrations.RunSQL( "ALTER TABLE child_health_monthly ADD COLUMN delivery_nature text" ), migrations.RunSQL( "ALTER TABLE child_health_monthly ADD COLUMN term_days smallint"), ] operations.extend(get_view_migrations())
def partition_child_health(): engine = connection_manager.get_engine(ICDS_UCR_CITUS_ENGINE_ID) queries = [ "ALTER TABLE child_health_monthly RENAME TO child_health_old_partition", "CREATE TABLE child_health_monthly (LIKE child_health_old_partition) PARTITION BY LIST (month)", "SELECT create_distributed_table('child_health_monthly', 'supervisor_id')", "ALTER TABLE child_health_monthly ATTACH PARTITION child_health_old_partition DEFAULT" ] with engine.begin() as connection: # check if we have already partitioned this table (necessary for reusedb) q = connection.execute("select exists (select * from pg_tables where tablename='child_health_old_partition')") if q.first()[0]: return for query in queries: connection.execute(query) for view in get_view_migrations(): with open(view.sql, "r", encoding='utf-8') as sql_file: sql_to_execute = sql_file.read() connection.execute(sql_to_execute)
class Migration(migrations.Migration): dependencies = [ ('icds_reports', '0116_daily_attendance_index'), ] operations = [ migrations.CreateModel( name='AwcLocationLocal', fields=[ ('awclocation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='icds_reports.AwcLocation')), ], options={ 'db_table': 'awc_location_local', 'managed': False, }, bases=('icds_reports.awclocation',), ), ] operations.extend(get_view_migrations()) operations.append(migrator.get_migration('service_delivery_monthly.sql'),)