# Generated by Django 3.2.13 on 2022-06-19 12:42

from django.db import migrations
from django.db.models import Case, F, Value, When


def set_null_to_empty_string(apps, _):
    UserProfile = apps.get_model("general", "UserProfile")
    qs = UserProfile.objects.all()

    qs.filter(street=None).update(street="")
    qs.filter(number=None).update(number="")
    qs.filter(postal=None).update(postal="")
    qs.filter(city=None).update(city="")
    qs.filter(province=None).update(province="")
    qs.filter(country=None).update(country="")


class Migration(migrations.Migration):

    dependencies = [
        ("general", "0003_alter_userprofile_country"),
    ]

    operations = [
        migrations.RunPython(set_null_to_empty_string, migrations.RunPython.noop),
    ]
