# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-03-21 12:39
from __future__ import unicode_literals

from django.db import migrations


def create_switch(apps, schema_editor):
    """Create the publish_person_to_marketing_site switch if it does not already exist."""
    Switch = apps.get_model('waffle', 'Switch')
    Switch.objects.get_or_create(name='publish_person_to_marketing_site', defaults={'active': False})


def delete_switch(apps, schema_editor):
    """Delete the publish_person_to_marketing_site switch."""
    Switch = apps.get_model('waffle', 'Switch')
    Switch.objects.filter(name='publish_person_to_marketing_site').delete()


class Migration(migrations.Migration):

    dependencies = [
        ('publisher', '0042_auto_20170306_1014'),
        ('waffle', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(create_switch, delete_switch),
    ]
