# Generated by Django 2.1.5 on 2019-05-22 06:47

from django.db import migrations, models
from common.constants import VISUALISATION_TOOLS


def insert_visualisation_tools(apps, schema_editor):
    VisualisationTool = apps.get_model(
        'common', 'VisualisationTool')
    for v in VISUALISATION_TOOLS:
        VisualisationTool.objects.get_or_create(name=v)


def revert_visualisation_tools(apps, schema_editor):
    VisualisationTool = apps.get_model(
        'common', 'VisualisationTool')
    VisualisationTool.objects.all().delete()


class Migration(migrations.Migration):

    dependencies = [
        ('common', '0007_questionnaire_data'),
    ]

    operations = [
        migrations.CreateModel(
            name='VisualisationTool',
            fields=[
                ('name', models.CharField(max_length=127, primary_key=True, serialize=False, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Visualisation Tool',
                'verbose_name_plural': 'Visualisation Tools',
                'db_table': 'visualisation_tool',
            },
        ),
        migrations.RunPython(insert_visualisation_tools, revert_visualisation_tools),
    ]
