# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-12-01 14:17
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('dataentry', '0074_questionlayout_form_config'),
    ]

    operations = [
        migrations.AddField(
            model_name='person',
            name='estimated_birthdate',
            field=models.DateField(null=True),
        ),
        migrations.RunSQL("update dataentry_person set estimated_birthdate = birthdate;"),

        migrations.RunSQL("update dataentry_person set age = null where id in (select person_id from dataentry_intercepteemalawi);"),
        migrations.RunSQL("update dataentry_person set age = null where id in (select person_id from dataentry_intercepteesouthafrica);"),
        
        migrations.RunSQL("update dataentry_person set birthdate = null where id in (select person_id from dataentry_intercepteebangladesh);"),
        migrations.RunSQL("update dataentry_person set birthdate = null where id in (select person_id from dataentry_intercepteeindia);"),
        migrations.RunSQL("update dataentry_person set birthdate = null where id in (select person_id from dataentry_intercepteenepal);"),
    ]
