# Generated by Django 2.2 on 2019-06-26 15:49

from django.db import migrations



def add_keys(apps, schema_editor):
    '''
    We can't import the Post model directly as it may be a newer
    version than this migration expects. We use the historical version.
    '''
    QA = apps.get_model('questionanswers', 'QA')
    for obj in QA.objects.all():
        obj.user_obj_2 = obj.user_obj
        obj.save()


def remove_keys(apps, schema_editor):
    '''
    We can't import the Post model directly as it may be a newer
    version than this migration expects. We use the historical version.
    '''
    # FileField = apps.get_model('filefields', 'FileField')
    QA = apps.get_model('questionanswers', 'QA')
    for obj in QA.objects.all():
        obj.user_obj = obj.user_obj_2
        obj.save()




class Migration(migrations.Migration):

    dependencies = [
        ('questionanswers', '0009_qa_user_obj_2'),
    ]

    operations = [
        migrations.RunPython(add_keys, reverse_code=remove_keys),
    ]
