# Generated by Django 2.2.17 on 2020-11-23 18:13

from django.db import migrations


def forward(apps, schema_editor):
    """
    Update min and max pace for most popular activity types
    """
    ActivityType = apps.get_model("routes", "ActivityType")
    ActivityType.objects.update_or_create(
        name="Run",
        defaults={
            "min_pace": 0.1,  # 1:40/km or 36 km/h
            "max_pace": 2.4,  # 40:00/km or 1.5 km/h
        }
    )
    ActivityType.objects.update_or_create(
        name="Ride",
        defaults={
            "min_pace": 0.036,  # 100 km/h
            "max_pace": 0.900,  # 4 km/h
        }
    )
    ActivityType.objects.update_or_create(
        name="Hike",
        defaults={
            "min_pace": 0.12,  # 2:00/km or 30 km/h
            "max_pace": 3.6,  # 60:00/km or 1 km/h
        }
    )
    ActivityType.objects.update_or_create(
        name="Walk",
        defaults={
            "min_pace": 0.12,  # 2:00/km or 30 km/h
            "max_pace": 3.6,  # 60:00/km or 1 km/h
        }
    )
    ActivityType.objects.update_or_create(
        name="BackcountrySki",
        defaults={
            "min_pace": 0.036,  # 100 km/h
            "max_pace": 3.6,  # 60:00/km or 1 km/h
        }
    )


class Migration(migrations.Migration):

    dependencies = [
        ('routes', '0057_refactor_prediction_model_fields'),
    ]

    operations = [
        migrations.RunPython(forward, migrations.RunPython.noop)
    ]
