# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-18 12:45
from __future__ import unicode_literals

from django.db import migrations
from django.db.migrations import RunPython


def remove_unzipped_result_size_that_are_zero(apps, schema_editor):
    Job = apps.get_model("conversion", "Job")  # noqa
    for job in Job.objects.filter(unzipped_result_size=0.0):
        job.unzipped_result_size = None
        job.estimated_pbf_size = None
        job.save()


def reverse_migration():
    # nothing to do, data isn't worse
    pass


class Migration(migrations.Migration):

    dependencies = [
        ('conversion', '0010_auto_20160713_1036'),
    ]

    operations = [
        RunPython(remove_unzipped_result_size_that_are_zero, reverse_migration)
    ]

add migration to remove falsely created zero values