# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations

def populate_brainstormers(apps, schema_editor):
    Brainstormer = apps.get_model("brainstormers", "Brainstormer")
    for brainstormer in Brainstormer.objects.all():
        brainstormer.title = brainstormer.template.title
        brainstormer.activity = brainstormer.template.activity
        brainstormer.save()


class Migration(migrations.Migration):

    dependencies = [
        ('brainstormers', '0010_change_brainstormer_like_template_copy'),
    ]

    operations = [
        migrations.RunPython(populate_brainstormers),
        migrations.RemoveField(
            model_name='brainstormer',
            name='template',
        ),
    ]
