# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2023-02-15 15:15
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('dataentry', '0246_auto_20230214_1300'),
    ]

    operations = [
        migrations.AddField(
            model_name='locationinformation',
            name='attempt_explanation',
            field=models.CharField(max_length=126, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='attempt_hide',
            field=models.CharField(max_length=126, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='free_to_go',
            field=models.CharField(max_length=126, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='free_to_go_explanation',
            field=models.CharField(max_length=126, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='persons_in_charge',
            field=models.CharField(max_length=126, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='pvs_visited',
            field=models.CharField(max_length=126, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='start_date',
            field=models.DateField(default=None, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='stay_how_long',
            field=models.CharField(max_length=126, null=True),
        ),
        migrations.AddField(
            model_name='locationinformation',
            name='suspects_associative',
            field=models.CharField(max_length=126, null=True),
        ),
        
        migrations.RunSQL("update dataentry_locationinformation li "\
                "set (attempt_explanation, attempt_hide, free_to_go, free_to_go_explanation, persons_in_charge,"\
                "pvs_visited, start_date, stay_how_long, suspects_associative) = "\
                    "((select attempt_explanation, attempt_hide, free_to_go, free_to_go_explanation, persons_in_charge,"\
                        "pvs_visited, start_date, stay_how_long, suspects_associative "\
                    "from dataentry_locationassociation la "\
                    "where li.lf_id = la.lf_id "\
                    "and li.incident_id = la.incident_id "\
                    "and li.source_type = la.source_type "\
                    "and li.source_title = la.source_title))")
    ]
