# Generated by Django 5.1.2 on 2024-10-28 21:53

import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("companies", "0002_stats_fields"),
        ("parks", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalRide",
            fields=[
                (
                    "id",
                    models.BigIntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("slug", models.SlugField(max_length=255)),
                ("description", models.TextField(blank=True)),
                (
                    "category",
                    models.CharField(
                        choices=[
                            ("RC", "Roller Coaster"),
                            ("DR", "Dark Ride"),
                            ("FR", "Flat Ride"),
                            ("WR", "Water Ride"),
                            ("TR", "Transport"),
                            ("OT", "Other"),
                        ],
                        default="OT",
                        max_length=2,
                    ),
                ),
                ("model_name", models.CharField(blank=True, max_length=255)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("OPERATING", "Operating"),
                            ("CLOSED_TEMP", "Temporarily Closed"),
                            ("CLOSED_PERM", "Permanently Closed"),
                            ("UNDER_CONSTRUCTION", "Under Construction"),
                            ("DEMOLISHED", "Demolished"),
                            ("RELOCATED", "Relocated"),
                        ],
                        default="OPERATING",
                        max_length=20,
                    ),
                ),
                ("opening_date", models.DateField(blank=True, null=True)),
                ("closing_date", models.DateField(blank=True, null=True)),
                ("status_since", models.DateField(blank=True, null=True)),
                ("min_height_in", models.PositiveIntegerField(blank=True, null=True)),
                ("max_height_in", models.PositiveIntegerField(blank=True, null=True)),
                ("accessibility_options", models.TextField(blank=True)),
                (
                    "capacity_per_hour",
                    models.PositiveIntegerField(blank=True, null=True),
                ),
                (
                    "ride_duration_seconds",
                    models.PositiveIntegerField(blank=True, null=True),
                ),
                (
                    "average_rating",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=3, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(blank=True, editable=False)),
                ("updated_at", models.DateTimeField(blank=True, editable=False)),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "manufacturer",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="companies.manufacturer",
                    ),
                ),
                (
                    "park",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="parks.park",
                    ),
                ),
                (
                    "park_area",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="parks.parkarea",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical ride",
                "verbose_name_plural": "historical rides",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Ride",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("slug", models.SlugField(max_length=255)),
                ("description", models.TextField(blank=True)),
                (
                    "category",
                    models.CharField(
                        choices=[
                            ("RC", "Roller Coaster"),
                            ("DR", "Dark Ride"),
                            ("FR", "Flat Ride"),
                            ("WR", "Water Ride"),
                            ("TR", "Transport"),
                            ("OT", "Other"),
                        ],
                        default="OT",
                        max_length=2,
                    ),
                ),
                ("model_name", models.CharField(blank=True, max_length=255)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("OPERATING", "Operating"),
                            ("CLOSED_TEMP", "Temporarily Closed"),
                            ("CLOSED_PERM", "Permanently Closed"),
                            ("UNDER_CONSTRUCTION", "Under Construction"),
                            ("DEMOLISHED", "Demolished"),
                            ("RELOCATED", "Relocated"),
                        ],
                        default="OPERATING",
                        max_length=20,
                    ),
                ),
                ("opening_date", models.DateField(blank=True, null=True)),
                ("closing_date", models.DateField(blank=True, null=True)),
                ("status_since", models.DateField(blank=True, null=True)),
                ("min_height_in", models.PositiveIntegerField(blank=True, null=True)),
                ("max_height_in", models.PositiveIntegerField(blank=True, null=True)),
                ("accessibility_options", models.TextField(blank=True)),
                (
                    "capacity_per_hour",
                    models.PositiveIntegerField(blank=True, null=True),
                ),
                (
                    "ride_duration_seconds",
                    models.PositiveIntegerField(blank=True, null=True),
                ),
                (
                    "average_rating",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=3, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "manufacturer",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="rides",
                        to="companies.manufacturer",
                    ),
                ),
                (
                    "park",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="rides",
                        to="parks.park",
                    ),
                ),
                (
                    "park_area",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="rides",
                        to="parks.parkarea",
                    ),
                ),
            ],
            options={
                "ordering": ["name"],
                "unique_together": {("park", "slug")},
            },
        ),
        migrations.CreateModel(
            name="HistoricalRollerCoasterStats",
            fields=[
                (
                    "id",
                    models.BigIntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "height_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=6, null=True
                    ),
                ),
                (
                    "length_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=7, null=True
                    ),
                ),
                (
                    "speed_mph",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=5, null=True
                    ),
                ),
                ("inversions", models.PositiveIntegerField(default=0)),
                (
                    "ride_time_seconds",
                    models.PositiveIntegerField(blank=True, null=True),
                ),
                ("track_type", models.CharField(blank=True, max_length=255)),
                (
                    "launch_type",
                    models.CharField(
                        choices=[
                            ("CHAIN", "Chain Lift"),
                            ("CABLE", "Cable Launch"),
                            ("HYDRAULIC", "Hydraulic Launch"),
                            ("LSM", "Linear Synchronous Motor"),
                            ("LIM", "Linear Induction Motor"),
                            ("GRAVITY", "Gravity"),
                            ("OTHER", "Other"),
                        ],
                        default="CHAIN",
                        max_length=20,
                    ),
                ),
                ("train_style", models.CharField(blank=True, max_length=255)),
                ("trains_count", models.PositiveIntegerField(blank=True, null=True)),
                ("cars_per_train", models.PositiveIntegerField(blank=True, null=True)),
                ("seats_per_car", models.PositiveIntegerField(blank=True, null=True)),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "ride",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Roller Coaster Statistics",
                "verbose_name_plural": "historical Roller Coaster Statistics",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="RollerCoasterStats",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "height_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=6, null=True
                    ),
                ),
                (
                    "length_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=7, null=True
                    ),
                ),
                (
                    "speed_mph",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=5, null=True
                    ),
                ),
                ("inversions", models.PositiveIntegerField(default=0)),
                (
                    "ride_time_seconds",
                    models.PositiveIntegerField(blank=True, null=True),
                ),
                ("track_type", models.CharField(blank=True, max_length=255)),
                (
                    "launch_type",
                    models.CharField(
                        choices=[
                            ("CHAIN", "Chain Lift"),
                            ("CABLE", "Cable Launch"),
                            ("HYDRAULIC", "Hydraulic Launch"),
                            ("LSM", "Linear Synchronous Motor"),
                            ("LIM", "Linear Induction Motor"),
                            ("GRAVITY", "Gravity"),
                            ("OTHER", "Other"),
                        ],
                        default="CHAIN",
                        max_length=20,
                    ),
                ),
                ("train_style", models.CharField(blank=True, max_length=255)),
                ("trains_count", models.PositiveIntegerField(blank=True, null=True)),
                ("cars_per_train", models.PositiveIntegerField(blank=True, null=True)),
                ("seats_per_car", models.PositiveIntegerField(blank=True, null=True)),
                (
                    "ride",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="coaster_stats",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "verbose_name": "Roller Coaster Statistics",
                "verbose_name_plural": "Roller Coaster Statistics",
            },
        ),
    ]
