# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2020-02-11 18:20
from __future__ import unicode_literals

from django.db import migrations, models, transaction


def create_default_schema(apps, schema_editor):
    LabellingSchema = apps.get_model('image_labelling_tool', 'LabellingSchema')

    with transaction.atomic():
        default_schemas = LabellingSchema.objects.filter(name='default')
        if not default_schemas.exists():
            default_schema = LabellingSchema(name='default')
            default_schema.save()


class Migration(migrations.Migration):

    dependencies = [
        ('image_labelling_tool', '0007_auto_20210322_1737'),
        ('example_labeller', '0003_dextrtask'),
    ]

    operations = [
        migrations.RunPython(create_default_schema),
    ]
