# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-31 06:47
from __future__ import unicode_literals

from django.db import migrations
import mtp.apps.questionnaires.managers


def migrate_workshops_to_questionnaire(apps, schema_editor):
    """Migrate the ``documents`` app models their ``media``app equivalent"""

    Quiz = apps.get_model(
        'questionnaires',
        'Quiz'
    )

    Quiz.objects.migrate_workshops_to_quiz()


def noop_backward_func(apps, schema_editor):
    """No turning back"""

    pass


class Migration(migrations.Migration):

    dependencies = [
        ('questionnaires', '0001_initial'),
        ('workshops', '0033_change_workshop_step_base_manager'),
    ]

    operations = [
        migrations.AlterModelManagers(
            name='quiz',
            managers=[
                ('objects', mtp.apps.questionnaires.managers.QuizManager()),
            ],
        ),
        migrations.RunPython(migrate_workshops_to_questionnaire, noop_backward_func)
    ]
