# Generated by Django 5.2.9 on 2026-01-02 02:30

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


class Migration(migrations.Migration):

    dependencies = [
        ("rides", "0031_add_ride_name_history"),
    ]

    operations = [
        pgtrigger.migrations.RemoveTrigger(
            model_name="ride",
            name="insert_insert",
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name="ride",
            name="update_update",
        ),
        migrations.AddField(
            model_name="ride",
            name="closing_date_precision",
            field=models.CharField(
                blank=True,
                choices=[("YEAR", "Year"), ("MONTH", "Month"), ("DAY", "Day")],
                default="DAY",
                help_text="Precision of the closing date",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="ride",
            name="opening_date_precision",
            field=models.CharField(
                blank=True,
                choices=[("YEAR", "Year"), ("MONTH", "Month"), ("DAY", "Day")],
                default="DAY",
                help_text="Precision of the opening date",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="rideevent",
            name="closing_date_precision",
            field=models.CharField(
                blank=True,
                choices=[("YEAR", "Year"), ("MONTH", "Month"), ("DAY", "Day")],
                default="DAY",
                help_text="Precision of the closing date",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="rideevent",
            name="opening_date_precision",
            field=models.CharField(
                blank=True,
                choices=[("YEAR", "Year"), ("MONTH", "Month"), ("DAY", "Day")],
                default="DAY",
                help_text="Precision of the opening date",
                max_length=10,
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="ride",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "rides_rideevent" ("average_rating", "banner_image_id", "capacity_per_hour", "card_image_id", "category", "closing_date", "closing_date_precision", "created_at", "description", "designer_id", "id", "manufacturer_id", "max_height_in", "min_height_in", "name", "opening_date", "opening_date_precision", "opening_year", "park_area_id", "park_id", "park_url", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "post_closing_status", "ride_duration_seconds", "ride_model_id", "search_text", "slug", "status", "status_since", "updated_at", "url") VALUES (NEW."average_rating", NEW."banner_image_id", NEW."capacity_per_hour", NEW."card_image_id", NEW."category", NEW."closing_date", NEW."closing_date_precision", NEW."created_at", NEW."description", NEW."designer_id", NEW."id", NEW."manufacturer_id", NEW."max_height_in", NEW."min_height_in", NEW."name", NEW."opening_date", NEW."opening_date_precision", NEW."opening_year", NEW."park_area_id", NEW."park_id", NEW."park_url", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."post_closing_status", NEW."ride_duration_seconds", NEW."ride_model_id", NEW."search_text", NEW."slug", NEW."status", NEW."status_since", NEW."updated_at", NEW."url"); RETURN NULL;',
                    hash="e0a64190a51762d71e695238a7ee9feedb95fd41",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_52074",
                    table="rides_ride",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="ride",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "rides_rideevent" ("average_rating", "banner_image_id", "capacity_per_hour", "card_image_id", "category", "closing_date", "closing_date_precision", "created_at", "description", "designer_id", "id", "manufacturer_id", "max_height_in", "min_height_in", "name", "opening_date", "opening_date_precision", "opening_year", "park_area_id", "park_id", "park_url", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "post_closing_status", "ride_duration_seconds", "ride_model_id", "search_text", "slug", "status", "status_since", "updated_at", "url") VALUES (NEW."average_rating", NEW."banner_image_id", NEW."capacity_per_hour", NEW."card_image_id", NEW."category", NEW."closing_date", NEW."closing_date_precision", NEW."created_at", NEW."description", NEW."designer_id", NEW."id", NEW."manufacturer_id", NEW."max_height_in", NEW."min_height_in", NEW."name", NEW."opening_date", NEW."opening_date_precision", NEW."opening_year", NEW."park_area_id", NEW."park_id", NEW."park_url", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."post_closing_status", NEW."ride_duration_seconds", NEW."ride_model_id", NEW."search_text", NEW."slug", NEW."status", NEW."status_since", NEW."updated_at", NEW."url"); RETURN NULL;',
                    hash="e3991e794f1239191cfe9095bab207527123b94f",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_4917a",
                    table="rides_ride",
                    when="AFTER",
                ),
            ),
        ),
    ]
