# Generated by Django 2.2.10 on 2020-06-12 08:59

from django.db import migrations, models


def forwards(apps, schema_editor):
    Case = apps.get_model('cases', 'Case')
    CaseVersion = apps.get_model('cases', 'CaseVersion')
    for row in Case.objects.all():
        row.medische_problemen_mbt_traplopen_check = 1 if row.medische_problemen_mbt_traplopen else 2 
        row.save(update_fields=['medische_problemen_mbt_traplopen_check'])

    for row in CaseVersion.objects.all():
        row.medische_problemen_mbt_traplopen_check = 1 if row.medische_problemen_mbt_traplopen else 2 
        row.save(update_fields=['medische_problemen_mbt_traplopen_check'])


class Migration(migrations.Migration):

    dependencies = [
        ('cases', '0014_auto_20200610_1104'),
    ]

    operations = [
        migrations.AddField(
            model_name='case',
            name='medische_problemen_mbt_traplopen_check',
            field=models.PositiveSmallIntegerField(blank=True, choices=[(2, 'Nee'), (1, 'Ja')], null=True, verbose_name='Zijn er medische problemen m.b.t. traplopen?'),
        ),
        migrations.AddField(
            model_name='caseversion',
            name='medische_problemen_mbt_traplopen_check',
            field=models.PositiveSmallIntegerField(blank=True, choices=[(2, 'Nee'), (1, 'Ja')], null=True, verbose_name='Zijn er medische problemen m.b.t. traplopen?'),
        ),
        migrations.RunPython(forwards),
    ]
