# Generated by Django 2.1.5 on 2019-01-31 16:28

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Bug 1523284: Create Fenix Product

from django.db import migrations


PRODUCT = "Fenix"
SORT = 5
IS_ACTIVE = True


def create_product(apps, schema_editor):
    Product = apps.get_model("crashstats", "Product")
    Product.objects.create(product_name=PRODUCT, sort=SORT, is_active=IS_ACTIVE)


def delete_product(apps, schema_editor):
    Product = apps.get_model("crashstats", "Product")
    Product.objects.filter(product_name=PRODUCT).delete()


class Migration(migrations.Migration):

    dependencies = [("crashstats", "0015_1463514-remove-eventlog")]

    operations = [migrations.RunPython(create_product, delete_product)]
