# Generated by Django 3.0.6 on 2020-11-02 18:31

from django.db import migrations

def fill_category(apps, schema_editor):
    categories = [
        'Maintenance',
        'Sheetmetal',
        'Helicopter MX',
        'Avionics',
        'Quality Inspector',
        'Interior Tech',
        'Pilot',
        'Engineering',
        'Sales',
        'Helicopter Pilot',
        'Dispatcher',
        'Flight Attendant',
        'Executive',
        'Accounting',
        'Office & Admin',
        'Other'
    ]
    Category = apps.get_model('postjob', 'Category')
    for name in categories:
        if Category.objects.filter(name=name).first() is None:
            new_data = Category(name=name)
            new_data.save()


class Migration(migrations.Migration):

    dependencies = [
        ('postjob', '0003_category_count'),
    ]

    operations = [
        migrations.RunPython(fill_category)
    ]
