# Generated by Django 2.1.4 on 2019-01-02 08:55

from django.db import migrations

def create_initial_categories(apps, schema_editor):
    Category = apps.get_model('core', 'Category')
    
    debt = Category.objects.create(name='Debt')
    entertainment = Category.objects.create(name='Entertainment')
    everyday = Category.objects.create(name='Everyday')

    Category.objects.bulk_create([
        Category(name='Credit Card', parent=debt),
        Category(name='Student Loans', parent=debt),
        Category(name='Taxes', parent=debt),
        Category(name='Books', parent=entertainment),
        Category(name='Games', parent=entertainment),
        Category(name='Groceries', parent=everyday),
        Category(name='Restaurants', parent=everyday),
    ])


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(create_initial_categories),
    ]
