# Generated by Django 3.1.2 on 2020-11-05 17:37

from django.db import migrations


def convert_null_to_empty(apps, schema_editor):
    WTOProfile = apps.get_model("wto", "WTOProfile")
    HistoricalWTOProfile = apps.get_model("wto", "HistoricalWTOProfile")

    WTOProfile.objects.filter(member_states__isnull=True).update(member_states=list())
    HistoricalWTOProfile.objects.filter(member_states__isnull=True).update(
        member_states=list()
    )


class Migration(migrations.Migration):

    dependencies = [
        ("wto", "0007_auto_20200901_1511"),
    ]

    operations = [
        migrations.RunPython(
            convert_null_to_empty, reverse_code=migrations.RunPython.noop
        ),
    ]
