# Generated by Django 2.2.12 on 2020-04-04 16:25

from django.db import migrations


"""
DE	DEU	276	Federal Republic of Germany	0	1	Germany
"""


def forwards_func(apps, schema_editor):
    # We get the model from the versioned app registry;
    # if we directly import it, it'll be the wrong version
    Country = apps.get_model("address", "Country")
    db_alias = schema_editor.connection.alias
    Country.objects.using(db_alias).bulk_create([
        Country(printable_name="Germany", is_shipping_country=True,
                display_order=0, name="Federal Republic of Germany",
                iso_3166_1_numeric=276, iso_3166_1_a3="DEU", iso_3166_1_a2="DE")
    ])


def reverse_func(apps, schema_editor):
    Country = apps.get_model("address", "Country")
    db_alias = schema_editor.connection.alias
    Country.objects.using(db_alias).filter(iso_3166_1_a2="DE").delete()


class Migration(migrations.Migration):

    dependencies = [
        ('partner', '0007_add_partner_address'),
    ]

    operations = [
        migrations.RunPython(forwards_func, reverse_func),
    ]
