# Generated by Django 2.2.4 on 2019-08-28 11:40

from django.db import migrations


def copy_establishment_type(apps, schemaeditor):
    EstablishmentType = apps.get_model('establishment', 'EstablishmentType')
    for et in EstablishmentType.objects.all():
        et.name = {'en': str(et.name_bak)}
        et.save()


def copy_establishment_subtype(apps, schemaeditor):
    EstablishmentSubType = apps.get_model('establishment', 'EstablishmentSubType')
    for est in EstablishmentSubType.objects.all():
        est.name = {'en': str(est.name_bak)}
        est.save()


class Migration(migrations.Migration):

    dependencies = [
        ('establishment', '0002_auto_20190828_0909'),
    ]

    operations = [
        migrations.RunPython(copy_establishment_type, migrations.RunPython.noop),
        migrations.RunPython(copy_establishment_subtype, migrations.RunPython.noop),
        migrations.RemoveField(
            model_name='establishmentsubtype',
            name='name_bak',
        ),
        migrations.RemoveField(
            model_name='establishmenttype',
            name='name_bak',
        ),
    ]
