# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2021-02-17 13:58
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('dataentry', '0172_auto_20210202_1943'),
    ]

    operations = [
                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 ('Kenya'))"
        ),
        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 ('Kenya'))"
        ),
        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 ('Kenya'))"
        ),
        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 ('Kenya'))"
        ),
    ]
