# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2020-09-15 18:26
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('dataentry', '0151_auto_20200903_1730'),
    ]

    operations = [
        migrations.AddField(
            model_name='vdfcommon',
            name='consent_to_use_photo',
            field=models.CharField(max_length=126, null=True, verbose_name='Do you consent to us using your photo this way?'),
        ),
        migrations.AddField(
            model_name='vdfcommon',
            name='evidence_that_guardians_sold',
            field=models.CharField(max_length=126, null=True, verbose_name='If yes, what evidence?'),
        ),
        migrations.AddField(
            model_name='vdfcommon',
            name='is_evidence_that_guardians_sold',
            field=models.CharField(max_length=126, null=True, verbose_name='Did the victim express any suicidal thoughts at any point?'),
        ),
        migrations.AddField(
            model_name='vdfcommon',
            name='where_victim_sent_details',
            field=models.CharField(max_length=126, null=True, verbose_name='Where was the victim sent details'),
        ),
        migrations.AddField(
            model_name='vdfcommon',
            name='why_sent_home_with_with_alarms',
            field=models.CharField(max_length=126, null=True, verbose_name='If the potential victim has 10 or more total Home Situation Alarms and you recommend sending the potential victim home to stay with guardians, why?'),
        ),
        migrations.RunSQL(
            "update dataentry_vdfcommon "\
            "set guardian_use_drugs='Rarely/Minor' "\
            "where guardian_use_drugs='Occasionally' "\
                "and id in (select vdf.id "\
                    "from dataentry_vdfcommon vdf "\
                    "    inner join dataentry_borderstation dbs on dbs.id = vdf.station_id "\
                    "    inner join dataentry_country dc on dc.id = dbs.operating_country_id "\
                    "where dc.name in ('Ghana','Rwanda','India','Uganda','Malawi'))"
        ),
        migrations.RunSQL(
            "update dataentry_vdfcommon "\
            "set guardian_use_drugs='Frequent/Severe' "\
            "where guardian_use_drugs='All the Time' "\
                "and id in (select vdf.id "\
                    "from dataentry_vdfcommon vdf "\
                    "    inner join dataentry_borderstation dbs on dbs.id = vdf.station_id "\
                    "    inner join dataentry_country dc on dc.id = dbs.operating_country_id "\
                    "where dc.name in ('Ghana','Rwanda','India','Uganda','Malawi'))"
        ),
        migrations.RunSQL(
            "update dataentry_vdfcommon "\
            "set where_victim_sent_details=where_victim_sent "\
            "where where_victim_sent is not null and where_victim_sent not in ('Home to stay with guardians','Sent to stay with other relatives', '') "\
                "and id in (select vdf.id "\
                    "from dataentry_vdfcommon vdf "\
                    "    inner join dataentry_borderstation dbs on dbs.id = vdf.station_id "\
                    "    inner join dataentry_country dc on dc.id = dbs.operating_country_id "\
                    "where dc.name in ('Ghana','Rwanda','India','Uganda','Malawi'))"
        ),
        migrations.RunSQL(
            "update dataentry_vdfcommon "\
            "set where_victim_sent='Found another place for them to go' "\
            "where where_victim_sent is not null and where_victim_sent not in ('Home to stay with guardians','Sent to stay with other relatives', '') "\
                "and id in (select vdf.id "\
                    "from dataentry_vdfcommon vdf "\
                    "    inner join dataentry_borderstation dbs on dbs.id = vdf.station_id "\
                    "    inner join dataentry_country dc on dc.id = dbs.operating_country_id "\
                    "where dc.name in ('Ghana','Rwanda','India','Uganda','Malawi'))"
        ),
    ]
