# Generated by Django 2.1.1 on 2018-09-11 17:19

from django.db import migrations


def copy_categories(apps, schema_editor):
    cls_idea = apps.get_model("demo_app", "Idea")
    for idea in cls_idea.objects.all():
        if idea.category:
            cls_idea.categories.add(idea.category)


class Migration(migrations.Migration):
    dependencies = [
        ('demo_app', '0003_categories_added'),
    ]

    operations = [
        migrations.RunPython(copy_categories),
    ]
