# Generated by Django 2.0.5 on 2018-07-05 11:32

from django.db import migrations

barriers_dummies_to_add = [
    {
        "title": "Goods Barrier type 1",
        "description": "Goods Barrier type 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "GOODS",
    },
    {
        "title": "Goods Barrier type 2",
        "description": "Goods Barrier type 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "GOODS",
    },
    {
        "title": "Goods Barrier type 3",
        "description": "Goods Barrier type 3 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "GOODS",
    },
    {
        "title": "Services Barrier type 1",
        "description": "Services Barrier type 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 2",
        "description": "Services Barrier type 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 3",
        "description": "Services Barrier type 3 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 4",
        "description": "Services Barrier type 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 5",
        "description": "Services Barrier type 5 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 6",
        "description": "Services Barrier type 6 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 7",
        "description": "Services Barrier type 7 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 8",
        "description": "Services Barrier type 8 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
    {
        "title": "Services Barrier type 9",
        "description": "Services Barrier type 9 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse accumsan ultrices lectus sodales fermentum. Proin hendrerit turpis sed elit interdum rutrum. Pellentesque congue imperdiet felis.",
        "category": "SERVICES",
    },
]


def add_dummy_barrier_types(apps, schema_editor):
    BarrierType = apps.get_model("metadata", "BarrierType")

    for item in barriers_dummies_to_add:
        try:
            barrier_type = BarrierType.objects.get(title=item["title"])
            barrier_type.description = item["description"]
            barrier_type.category = item["category"]
            barrier_type.save()
        except BarrierType.DoesNotExist:
            BarrierType(
                title=item["title"],
                description=item["description"],
                category=item["category"],
            ).save()


class Migration(migrations.Migration):

    dependencies = [("metadata", "0002_auto_20180704_1647")]

    operations = [migrations.RunPython(add_dummy_barrier_types)]
