# Generated by Django 2.1.4 on 2019-07-08 12:00

from django.db import migrations
import jsonfield.fields


class Migration(migrations.Migration):

    dependencies = [
        ('daiquiri_query', '0023_queryjob_uploads'),
    ]

    def migrate_data(apps, schema_editor):

        QueryJob = apps.get_model('daiquiri_query', 'queryjob')

        for job in QueryJob.objects.all():
            if job.metadata in ['', '""']:
                job.metadata = None
            job.save()

    operations = [
        migrations.AlterField(
            model_name='queryjob',
            name='metadata',
            field=jsonfield.fields.JSONField(blank=True, null=True),
        ),
        migrations.RunPython(migrate_data),
    ]
