# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-25 13:46
from __future__ import unicode_literals

from django.db import migrations

fixture_os = ['Linux', 'Macos', 'Windows']

def forwards_func(apps, schema_editor):
    # We get the model from the versioned app registry;
    # if we directly import it, it'll be the wrong version
    OperatingSystem = apps.get_model("main", "OperatingSystem")
    db_alias = schema_editor.connection.alias
    os_to_create = [OperatingSystem(name=os) for os in fixture_os]
    OperatingSystem.objects.using(db_alias).bulk_create(os_to_create)

def reverse_func(apps, schema_editor):
    OperatingSystem = apps.get_model("main", "OperatingSystem")
    db_alias = schema_editor.connection.alias
    for os in fixture_os:
        Country.objects.using(db_alias).filter(name=os).delete()


class Migration(migrations.Migration):

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

    operations = [
        migrations.RunPython(forwards_func, reverse_func),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-25 13:46
from __future__ import unicode_literals

from django.db import migrations

fixture_os = ['Linux', 'Macos', 'Windows']

def forwards_func(apps, schema_editor):
    # We get the model from the versioned app registry;
    # if we directly import it, it'll be the wrong version
    OperatingSystem = apps.get_model("main", "OperatingSystem")
    db_alias = schema_editor.connection.alias
    os_to_create = [OperatingSystem(name=os) for os in fixture_os]
    OperatingSystem.objects.using(db_alias).bulk_create(os_to_create)

def reverse_func(apps, schema_editor):
    OperatingSystem = apps.get_model("main", "OperatingSystem")
    db_alias = schema_editor.connection.alias
    for os in fixture_os:
        OperatingSystem.objects.using(db_alias).filter(name=os).delete()


class Migration(migrations.Migration):

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

    operations = [
        migrations.RunPython(forwards_func, reverse_func),
    ]

fix typo reverse migration