# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2020-02-28 17:30
from __future__ import unicode_literals


from django.conf import settings
from django.db import migrations


FIELDS = (
    ('theme', 'theme', 'label'),
)


def forward(apps, schema_editor):
    with schema_editor.connection.cursor() as cursor:
        for lang in settings.MODELTRANSLATION_LANGUAGES:
            for model, old, new in FIELDS:
                cursor.execute(
                    "SELECT 1 FROM information_schema.columns WHERE table_name='common_{}' AND column_name='{}_{}'".format(model, old, lang)
                )
                if cursor.fetchone():
                    cursor.execute('ALTER TABLE common_{} RENAME {}_{} TO {}_{}'.format(model, old, lang, new, lang))


class Migration(migrations.Migration):

    dependencies = [
        ('common', '0007_auto_20200228_1755'),
    ]

    operations = [
        migrations.RunPython(forward),
    ]

f5725b761190b4b70d489738d10ea651c43ab22a
<mask token>


class Migration(migrations.Migration):
    dependencies = [('common', '0007_auto_20200228_1755')]
    operations = [migrations.RunPython(forward)]

<mask token>


def forward(apps, schema_editor):
    with schema_editor.connection.cursor() as cursor:
        for lang in settings.MODELTRANSLATION_LANGUAGES:
            for model, old, new in FIELDS:
                cursor.execute(
                    "SELECT 1 FROM information_schema.columns WHERE table_name='common_{}' AND column_name='{}_{}'"
                    .format(model, old, lang))
                if cursor.fetchone():
                    cursor.execute(
                        'ALTER TABLE common_{} RENAME {}_{} TO {}_{}'.
                        format(model, old, lang, new, lang))


class Migration(migrations.Migration):
    dependencies = [('common', '0007_auto_20200228_1755')]
    operations = [migrations.RunPython(forward)]

<mask token>
FIELDS = ('theme', 'theme', 'label'),


def forward(apps, schema_editor):
    with schema_editor.connection.cursor() as cursor:
        for lang in settings.MODELTRANSLATION_LANGUAGES:
            for model, old, new in FIELDS:
                cursor.execute(
                    "SELECT 1 FROM information_schema.columns WHERE table_name='common_{}' AND column_name='{}_{}'"
                    .format(model, old, lang))
                if cursor.fetchone():
                    cursor.execute(
                        'ALTER TABLE common_{} RENAME {}_{} TO {}_{}'.
                        format(model, old, lang, new, lang))


class Migration(migrations.Migration):
    dependencies = [('common', '0007_auto_20200228_1755')]
    operations = [migrations.RunPython(forward)]

from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
FIELDS = ('theme', 'theme', 'label'),


def forward(apps, schema_editor):
    with schema_editor.connection.cursor() as cursor:
        for lang in settings.MODELTRANSLATION_LANGUAGES:
            for model, old, new in FIELDS:
                cursor.execute(
                    "SELECT 1 FROM information_schema.columns WHERE table_name='common_{}' AND column_name='{}_{}'"
                    .format(model, old, lang))
                if cursor.fetchone():
                    cursor.execute(
                        'ALTER TABLE common_{} RENAME {}_{} TO {}_{}'.
                        format(model, old, lang, new, lang))


class Migration(migrations.Migration):
    dependencies = [('common', '0007_auto_20200228_1755')]
    operations = [migrations.RunPython(forward)]

# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2020-02-28 17:30
from __future__ import unicode_literals


from django.conf import settings
from django.db import migrations


FIELDS = (
    ('theme', 'theme', 'label'),
)


def forward(apps, schema_editor):
    with schema_editor.connection.cursor() as cursor:
        for lang in settings.MODELTRANSLATION_LANGUAGES:
            for model, old, new in FIELDS:
                cursor.execute(
                    "SELECT 1 FROM information_schema.columns WHERE table_name='common_{}' AND column_name='{}_{}'".format(model, old, lang)
                )
                if cursor.fetchone():
                    cursor.execute('ALTER TABLE common_{} RENAME {}_{} TO {}_{}'.format(model, old, lang, new, lang))


class Migration(migrations.Migration):

    dependencies = [
        ('common', '0007_auto_20200228_1755'),
    ]

    operations = [
        migrations.RunPython(forward),
    ]
