# Generated by Django 5.2.9 on 2025-12-27 20:58

import django.db.models.deletion
import pgtrigger.compiler
import pgtrigger.migrations
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("pghistory", "0006_delete_aggregateevent"),
        ("rides", "0028_ridecredit_ridecreditevent_ridecredit_insert_insert_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="DarkRideStats",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("scene_count", models.PositiveIntegerField(default=0, help_text="Number of themed scenes")),
                (
                    "animatronic_count",
                    models.PositiveIntegerField(default=0, help_text="Number of animatronic figures"),
                ),
                (
                    "has_projection_technology",
                    models.BooleanField(default=False, help_text="Whether the ride uses projection mapping or screens"),
                ),
                (
                    "is_interactive",
                    models.BooleanField(
                        default=False, help_text="Whether riders can interact with elements (shooting, etc.)"
                    ),
                ),
                (
                    "ride_system",
                    models.CharField(
                        blank=True,
                        help_text="Type of ride system (Omnimover, Trackless, Classic Track, etc.)",
                        max_length=100,
                    ),
                ),
                (
                    "uses_practical_effects",
                    models.BooleanField(default=True, help_text="Whether the ride uses practical/physical effects"),
                ),
                (
                    "uses_motion_base",
                    models.BooleanField(default=False, help_text="Whether vehicles have motion simulation capability"),
                ),
                (
                    "ride",
                    models.OneToOneField(
                        help_text="Ride these dark ride statistics belong to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="dark_stats",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "verbose_name": "Dark Ride Statistics",
                "verbose_name_plural": "Dark Ride Statistics",
                "ordering": ["ride"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="DarkRideStatsEvent",
            fields=[
                ("pgh_id", models.AutoField(primary_key=True, serialize=False)),
                ("pgh_created_at", models.DateTimeField(auto_now_add=True)),
                ("pgh_label", models.TextField(help_text="The event label.")),
                ("id", models.BigIntegerField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("scene_count", models.PositiveIntegerField(default=0, help_text="Number of themed scenes")),
                (
                    "animatronic_count",
                    models.PositiveIntegerField(default=0, help_text="Number of animatronic figures"),
                ),
                (
                    "has_projection_technology",
                    models.BooleanField(default=False, help_text="Whether the ride uses projection mapping or screens"),
                ),
                (
                    "is_interactive",
                    models.BooleanField(
                        default=False, help_text="Whether riders can interact with elements (shooting, etc.)"
                    ),
                ),
                (
                    "ride_system",
                    models.CharField(
                        blank=True,
                        help_text="Type of ride system (Omnimover, Trackless, Classic Track, etc.)",
                        max_length=100,
                    ),
                ),
                (
                    "uses_practical_effects",
                    models.BooleanField(default=True, help_text="Whether the ride uses practical/physical effects"),
                ),
                (
                    "uses_motion_base",
                    models.BooleanField(default=False, help_text="Whether vehicles have motion simulation capability"),
                ),
                (
                    "pgh_context",
                    models.ForeignKey(
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="pghistory.context",
                    ),
                ),
                (
                    "pgh_obj",
                    models.ForeignKey(
                        db_constraint=False,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="events",
                        to="rides.darkridestats",
                    ),
                ),
                (
                    "ride",
                    models.ForeignKey(
                        db_constraint=False,
                        help_text="Ride these dark ride statistics belong to",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        related_query_name="+",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="FlatRideStats",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "max_height_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum ride height in feet", max_digits=6, null=True
                    ),
                ),
                (
                    "rotation_speed_rpm",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum rotation speed in RPM", max_digits=5, null=True
                    ),
                ),
                (
                    "swing_angle_degrees",
                    models.PositiveIntegerField(
                        blank=True, help_text="Maximum swing angle in degrees (for swinging rides)", null=True
                    ),
                ),
                (
                    "motion_type",
                    models.CharField(
                        choices=[
                            ("SPINNING", "Spinning"),
                            ("SWINGING", "Swinging"),
                            ("BOUNCING", "Bouncing"),
                            ("ROTATING", "Rotating"),
                            ("DROPPING", "Dropping"),
                            ("MIXED", "Mixed Motion"),
                        ],
                        default="SPINNING",
                        help_text="Primary type of motion",
                        max_length=20,
                    ),
                ),
                ("arm_count", models.PositiveIntegerField(blank=True, help_text="Number of arms/gondolas", null=True)),
                (
                    "seats_per_gondola",
                    models.PositiveIntegerField(blank=True, help_text="Number of seats per gondola/arm", null=True),
                ),
                (
                    "max_g_force",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum G-force experienced", max_digits=4, null=True
                    ),
                ),
                (
                    "ride",
                    models.OneToOneField(
                        help_text="Ride these flat ride statistics belong to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="flat_stats",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "verbose_name": "Flat Ride Statistics",
                "verbose_name_plural": "Flat Ride Statistics",
                "ordering": ["ride"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="FlatRideStatsEvent",
            fields=[
                ("pgh_id", models.AutoField(primary_key=True, serialize=False)),
                ("pgh_created_at", models.DateTimeField(auto_now_add=True)),
                ("pgh_label", models.TextField(help_text="The event label.")),
                ("id", models.BigIntegerField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "max_height_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum ride height in feet", max_digits=6, null=True
                    ),
                ),
                (
                    "rotation_speed_rpm",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum rotation speed in RPM", max_digits=5, null=True
                    ),
                ),
                (
                    "swing_angle_degrees",
                    models.PositiveIntegerField(
                        blank=True, help_text="Maximum swing angle in degrees (for swinging rides)", null=True
                    ),
                ),
                (
                    "motion_type",
                    models.CharField(
                        choices=[
                            ("SPINNING", "Spinning"),
                            ("SWINGING", "Swinging"),
                            ("BOUNCING", "Bouncing"),
                            ("ROTATING", "Rotating"),
                            ("DROPPING", "Dropping"),
                            ("MIXED", "Mixed Motion"),
                        ],
                        default="SPINNING",
                        help_text="Primary type of motion",
                        max_length=20,
                    ),
                ),
                ("arm_count", models.PositiveIntegerField(blank=True, help_text="Number of arms/gondolas", null=True)),
                (
                    "seats_per_gondola",
                    models.PositiveIntegerField(blank=True, help_text="Number of seats per gondola/arm", null=True),
                ),
                (
                    "max_g_force",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum G-force experienced", max_digits=4, null=True
                    ),
                ),
                (
                    "pgh_context",
                    models.ForeignKey(
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="pghistory.context",
                    ),
                ),
                (
                    "pgh_obj",
                    models.ForeignKey(
                        db_constraint=False,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="events",
                        to="rides.flatridestats",
                    ),
                ),
                (
                    "ride",
                    models.ForeignKey(
                        db_constraint=False,
                        help_text="Ride these flat ride statistics belong to",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        related_query_name="+",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="WaterRideStats",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "wetness_level",
                    models.CharField(
                        choices=[
                            ("DRY", "Dry - No water contact"),
                            ("MILD", "Mild - Light misting"),
                            ("MODERATE", "Moderate - Some splashing"),
                            ("SOAKING", "Soaking - Prepare to get drenched"),
                        ],
                        default="MODERATE",
                        help_text="How wet riders typically get",
                        max_length=10,
                    ),
                ),
                (
                    "splash_height_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum splash height in feet", max_digits=5, null=True
                    ),
                ),
                (
                    "has_splash_zone",
                    models.BooleanField(
                        default=False, help_text="Whether there is a designated splash zone for spectators"
                    ),
                ),
                (
                    "boat_capacity",
                    models.PositiveIntegerField(blank=True, help_text="Number of riders per boat/raft", null=True),
                ),
                (
                    "uses_flume",
                    models.BooleanField(default=False, help_text="Whether the ride uses a flume/log system"),
                ),
                (
                    "rapids_sections",
                    models.PositiveIntegerField(default=0, help_text="Number of rapids/whitewater sections"),
                ),
                (
                    "ride",
                    models.OneToOneField(
                        help_text="Ride these water statistics belong to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="water_stats",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "verbose_name": "Water Ride Statistics",
                "verbose_name_plural": "Water Ride Statistics",
                "ordering": ["ride"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="WaterRideStatsEvent",
            fields=[
                ("pgh_id", models.AutoField(primary_key=True, serialize=False)),
                ("pgh_created_at", models.DateTimeField(auto_now_add=True)),
                ("pgh_label", models.TextField(help_text="The event label.")),
                ("id", models.BigIntegerField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "wetness_level",
                    models.CharField(
                        choices=[
                            ("DRY", "Dry - No water contact"),
                            ("MILD", "Mild - Light misting"),
                            ("MODERATE", "Moderate - Some splashing"),
                            ("SOAKING", "Soaking - Prepare to get drenched"),
                        ],
                        default="MODERATE",
                        help_text="How wet riders typically get",
                        max_length=10,
                    ),
                ),
                (
                    "splash_height_ft",
                    models.DecimalField(
                        blank=True, decimal_places=2, help_text="Maximum splash height in feet", max_digits=5, null=True
                    ),
                ),
                (
                    "has_splash_zone",
                    models.BooleanField(
                        default=False, help_text="Whether there is a designated splash zone for spectators"
                    ),
                ),
                (
                    "boat_capacity",
                    models.PositiveIntegerField(blank=True, help_text="Number of riders per boat/raft", null=True),
                ),
                (
                    "uses_flume",
                    models.BooleanField(default=False, help_text="Whether the ride uses a flume/log system"),
                ),
                (
                    "rapids_sections",
                    models.PositiveIntegerField(default=0, help_text="Number of rapids/whitewater sections"),
                ),
                (
                    "pgh_context",
                    models.ForeignKey(
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="pghistory.context",
                    ),
                ),
                (
                    "pgh_obj",
                    models.ForeignKey(
                        db_constraint=False,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="events",
                        to="rides.waterridestats",
                    ),
                ),
                (
                    "ride",
                    models.ForeignKey(
                        db_constraint=False,
                        help_text="Ride these water statistics belong to",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        related_query_name="+",
                        to="rides.ride",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="darkridestats",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "rides_darkridestatsevent" ("animatronic_count", "created_at", "has_projection_technology", "id", "is_interactive", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_id", "ride_system", "scene_count", "updated_at", "uses_motion_base", "uses_practical_effects") VALUES (NEW."animatronic_count", NEW."created_at", NEW."has_projection_technology", NEW."id", NEW."is_interactive", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."ride_id", NEW."ride_system", NEW."scene_count", NEW."updated_at", NEW."uses_motion_base", NEW."uses_practical_effects"); RETURN NULL;',
                    hash="055ece465263a190b67dda7258c4bf26fa939107",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_78d6d",
                    table="rides_darkridestats",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="darkridestats",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "rides_darkridestatsevent" ("animatronic_count", "created_at", "has_projection_technology", "id", "is_interactive", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_id", "ride_system", "scene_count", "updated_at", "uses_motion_base", "uses_practical_effects") VALUES (NEW."animatronic_count", NEW."created_at", NEW."has_projection_technology", NEW."id", NEW."is_interactive", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."ride_id", NEW."ride_system", NEW."scene_count", NEW."updated_at", NEW."uses_motion_base", NEW."uses_practical_effects"); RETURN NULL;',
                    hash="e7421fdd5dd3f044c5cc324db3e5d948e8f39afe",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_8eac1",
                    table="rides_darkridestats",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="flatridestats",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "rides_flatridestatsevent" ("arm_count", "created_at", "id", "max_g_force", "max_height_ft", "motion_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_id", "rotation_speed_rpm", "seats_per_gondola", "swing_angle_degrees", "updated_at") VALUES (NEW."arm_count", NEW."created_at", NEW."id", NEW."max_g_force", NEW."max_height_ft", NEW."motion_type", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."ride_id", NEW."rotation_speed_rpm", NEW."seats_per_gondola", NEW."swing_angle_degrees", NEW."updated_at"); RETURN NULL;',
                    hash="04edef9ce6235f57c5b53f052a7fe392835f2971",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_a589a",
                    table="rides_flatridestats",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="flatridestats",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "rides_flatridestatsevent" ("arm_count", "created_at", "id", "max_g_force", "max_height_ft", "motion_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_id", "rotation_speed_rpm", "seats_per_gondola", "swing_angle_degrees", "updated_at") VALUES (NEW."arm_count", NEW."created_at", NEW."id", NEW."max_g_force", NEW."max_height_ft", NEW."motion_type", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."ride_id", NEW."rotation_speed_rpm", NEW."seats_per_gondola", NEW."swing_angle_degrees", NEW."updated_at"); RETURN NULL;',
                    hash="6f48930fae214744ad60cf8755ee0d50897d1040",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_f949f",
                    table="rides_flatridestats",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="waterridestats",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "rides_waterridestatsevent" ("boat_capacity", "created_at", "has_splash_zone", "id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rapids_sections", "ride_id", "splash_height_ft", "updated_at", "uses_flume", "wetness_level") VALUES (NEW."boat_capacity", NEW."created_at", NEW."has_splash_zone", NEW."id", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."rapids_sections", NEW."ride_id", NEW."splash_height_ft", NEW."updated_at", NEW."uses_flume", NEW."wetness_level"); RETURN NULL;',
                    hash="bb61031dc606f90bf9970f76417b30a72d8469ce",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_fb731",
                    table="rides_waterridestats",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="waterridestats",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "rides_waterridestatsevent" ("boat_capacity", "created_at", "has_splash_zone", "id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rapids_sections", "ride_id", "splash_height_ft", "updated_at", "uses_flume", "wetness_level") VALUES (NEW."boat_capacity", NEW."created_at", NEW."has_splash_zone", NEW."id", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."rapids_sections", NEW."ride_id", NEW."splash_height_ft", NEW."updated_at", NEW."uses_flume", NEW."wetness_level"); RETURN NULL;',
                    hash="98404ec47c9b8d577f0a408a1182f9adffda7784",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_4f7a3",
                    table="rides_waterridestats",
                    when="AFTER",
                ),
            ),
        ),
    ]
