# Generated by Django 1.11.4 on 2017-09-19 18:32

from django.db import migrations


def create_accounts(apps, schema_editor):
    from byro.bookkeeping.models import AccountCategory

    Account = apps.get_model("bookkeeping", "Account")
    for category in (
        "member_donation",
        "member_fees",
    ):  # Not the constants, because the class got refactored
        Account.objects.create(account_category=category)


def delete_accounts(apps, schema_editor):
    Account = apps.get_model("bookkeeping", "Account")
    Account.objects.all().delete()


class Migration(migrations.Migration):
    dependencies = [("bookkeeping", "0004_auto_20170919_1832")]

    operations = [migrations.RunPython(create_accounts, delete_accounts)]
