# Generated by Django 2.2.13 on 2021-03-01 16:49

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ("rates", "0001_initial"),
    ]

    def update_missed_reservation_rates(apps, schema_editor):
        RateModel = apps.get_model("rates", "Rate")
        # we previously assumed missed reservation rates were flat. make it explicit now
        RateModel.objects.filter(type__type__in=["AREA_MISSED_RESERVATION", "TOOL_MISSED_RESERVATION"]).update(
            flat=True
        )

    operations = [
        migrations.RunPython(update_missed_reservation_rates),
    ]
