# Generated by Django 3.1.5 on 2021-01-28 17:09

import datetime

import colorfield.fields
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import wkz.models


class Migration(migrations.Migration):

    replaces = [
        ("wkz", "0002_auto_20200704_1728"),
        ("wkz", "0003_auto_20200709_0742"),
        ("wkz", "0004_traces_distance_list"),
        ("wkz", "0005_auto_20201010_1101"),
        ("wkz", "0006_settings_run_file_importer_in_background"),
        ("wkz", "0007_auto_20201229_1033"),
        ("wkz", "0008_bestsection_bestsectiontype"),
        ("wkz", "0009_auto_20201230_0827"),
        ("wkz", "0010_auto_20201230_1038"),
        ("wkz", "0011_bestsection_section_distance"),
        ("wkz", "0012_bestsectiontopscores"),
        ("wkz", "0013_auto_20210101_1818"),
        ("wkz", "0014_auto_20210112_1924"),
    ]

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Sport",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(max_length=24, unique=True, verbose_name="Sport Name:")),
                ("color", colorfield.fields.ColorField(default="#42FF71", max_length=18, verbose_name="Color:")),
                ("icon", models.CharField(max_length=24, verbose_name="Icon:")),
                ("slug", models.SlugField(blank=True, max_length=100, unique=True)),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name="Traces",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path_to_file", models.CharField(max_length=200)),
                ("file_name", models.CharField(editable=False, max_length=100)),
                ("md5sum", models.CharField(max_length=32, unique=True)),
                ("altitude_list", models.CharField(default="[]", max_length=10000000000)),
                ("heart_rate_list", models.CharField(default="[]", max_length=10000000000)),
                ("max_altitude", models.FloatField(blank=True, null=True)),
                ("min_altitude", models.FloatField(blank=True, null=True)),
                ("aerobic_training_effect", models.FloatField(blank=True, null=True)),
                ("anaerobic_training_effect", models.FloatField(blank=True, null=True)),
                ("avg_cadence", models.IntegerField(blank=True, null=True)),
                ("avg_heart_rate", models.IntegerField(blank=True, null=True)),
                ("avg_speed", models.FloatField(blank=True, null=True)),
                ("avg_temperature", models.IntegerField(blank=True, null=True)),
                ("cadence_list", models.CharField(default="[]", max_length=10000000000)),
                ("max_cadence", models.IntegerField(blank=True, null=True)),
                ("max_heart_rate", models.IntegerField(blank=True, null=True)),
                ("max_speed", models.FloatField(blank=True, null=True)),
                ("max_temperature", models.IntegerField(blank=True, null=True)),
                ("speed_list", models.CharField(default="[]", max_length=10000000000)),
                ("temperature_list", models.CharField(default="[]", max_length=10000000000)),
                ("min_cadence", models.IntegerField(blank=True, null=True)),
                ("min_heart_rate", models.IntegerField(blank=True, null=True)),
                ("min_speed", models.FloatField(blank=True, null=True)),
                ("min_temperature", models.IntegerField(blank=True, null=True)),
                ("calories", models.IntegerField(blank=True, null=True)),
                ("timestamps_list", models.CharField(default="[]", max_length=10000000000)),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
                ("distance_list", models.CharField(default="[]", max_length=10000000000)),
                ("latitude_list", models.CharField(default="[]", max_length=10000000000)),
                ("longitude_list", models.CharField(default="[]", max_length=10000000000)),
            ],
        ),
        migrations.CreateModel(
            name="Lap",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("start_time", models.DateTimeField()),
                ("end_time", models.DateTimeField()),
                ("elapsed_time", models.DurationField()),
                ("start_lat", models.FloatField(blank=True, null=True)),
                ("start_long", models.FloatField(blank=True, null=True)),
                ("end_lat", models.FloatField(blank=True, null=True)),
                ("end_long", models.FloatField(blank=True, null=True)),
                ("distance", models.FloatField(blank=True, null=True)),
                ("speed", models.FloatField(blank=True, null=True)),
                ("trace", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="wkz.traces")),
                ("trigger", models.CharField(max_length=120)),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
                ("label", models.CharField(blank=True, max_length=100, null=True, verbose_name="Label:")),
            ],
        ),
        migrations.CreateModel(
            name="Activity",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(default="unknown", max_length=200, verbose_name="Activity Name:")),
                ("date", models.DateTimeField(default=django.utils.timezone.now, verbose_name="Date:")),
                ("duration", models.DurationField(default=datetime.timedelta(seconds=1800), verbose_name="Duration:")),
                ("distance", models.FloatField(blank=True, default=0, null=True, verbose_name="Distance:")),
                ("description", models.CharField(blank=True, max_length=600, null=True, verbose_name="Description:")),
                (
                    "sport",
                    models.ForeignKey(
                        default=wkz.models.default_sport,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        to="wkz.sport",
                        verbose_name="Sport:",
                    ),
                ),
                (
                    "trace_file",
                    models.ForeignKey(
                        blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to="wkz.traces"
                    ),
                ),
                ("is_demo_activity", models.BooleanField(default=False, verbose_name="Is this a Demo Activity:")),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name="Settings",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "path_to_trace_dir",
                    models.CharField(
                        default="/workspaces/workoutizer/tracks",
                        max_length=120,
                        verbose_name="Path to Traces Directory:",
                    ),
                ),
                (
                    "path_to_garmin_device",
                    models.CharField(
                        default="/run/user/1000/gvfs/", max_length=120, verbose_name="Path to Garmin Device:"
                    ),
                ),
                (
                    "number_of_days",
                    models.IntegerField(
                        choices=[(9999, "all"), (365, 365), (180, 180), (90, 90), (30, 30), (10, 10)], default=30
                    ),
                ),
                (
                    "delete_files_after_import",
                    models.BooleanField(default=False, verbose_name="Delete fit Files after Copying: "),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name="BestSection",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("start_index", models.IntegerField()),
                ("end_index", models.IntegerField()),
                ("max_value", models.FloatField()),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
                ("activity", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="wkz.activity")),
                ("section_type", models.CharField(max_length=120)),
                ("section_distance", models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name="BestSectionTopScores",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("rank", models.IntegerField(choices=[(1, "First"), (2, "Second"), (3, "Third")])),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
                ("activity", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="wkz.activity")),
                ("sport", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="wkz.sport")),
                (
                    "section",
                    models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to="wkz.bestsection"),
                ),
            ],
        ),
    ]
