# Generated by Django 5.2.9 on 2026-01-07 21:01

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


class Migration(migrations.Migration):

    dependencies = [
        ('parks', '0028_add_date_precision_fields'),
        ('rides', '0034_add_ride_category_fields'),
    ]

    operations = [
        pgtrigger.migrations.RemoveTrigger(
            model_name='company',
            name='insert_insert',
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name='company',
            name='update_update',
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name='ridemodel',
            name='insert_insert',
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name='ridemodel',
            name='update_update',
        ),
        migrations.AddField(
            model_name='company',
            name='banner_image_id',
            field=models.CharField(blank=True, help_text='Cloudflare image ID for banner image', max_length=255),
        ),
        migrations.AddField(
            model_name='company',
            name='card_image_id',
            field=models.CharField(blank=True, help_text='Cloudflare image ID for card image', max_length=255),
        ),
        migrations.AddField(
            model_name='company',
            name='founded_date_precision',
            field=models.CharField(blank=True, choices=[('exact', 'Exact'), ('month', 'Month'), ('year', 'Year'), ('decade', 'Decade'), ('century', 'Century'), ('approximate', 'Approximate')], default='', help_text='Precision of the founded date', max_length=20),
        ),
        migrations.AddField(
            model_name='company',
            name='founded_year',
            field=models.PositiveIntegerField(blank=True, help_text='Year the company was founded (alternative to founded_date)', null=True),
        ),
        migrations.AddField(
            model_name='company',
            name='headquarters_location',
            field=models.CharField(blank=True, help_text="Headquarters location description (e.g., 'Los Angeles, CA, USA')", max_length=200),
        ),
        migrations.AddField(
            model_name='company',
            name='location',
            field=models.ForeignKey(blank=True, help_text='Linked location record for headquarters', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='companies', to='parks.parklocation'),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='banner_image_id',
            field=models.CharField(blank=True, help_text='Cloudflare image ID for banner image', max_length=255),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='card_image_id',
            field=models.CharField(blank=True, help_text='Cloudflare image ID for card image', max_length=255),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='founded_date_precision',
            field=models.CharField(blank=True, choices=[('exact', 'Exact'), ('month', 'Month'), ('year', 'Year'), ('decade', 'Decade'), ('century', 'Century'), ('approximate', 'Approximate')], default='', help_text='Precision of the founded date', max_length=20),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='founded_year',
            field=models.PositiveIntegerField(blank=True, help_text='Year the company was founded (alternative to founded_date)', null=True),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='headquarters_location',
            field=models.CharField(blank=True, help_text="Headquarters location description (e.g., 'Los Angeles, CA, USA')", max_length=200),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='location',
            field=models.ForeignKey(blank=True, db_constraint=False, help_text='Linked location record for headquarters', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', related_query_name='+', to='parks.parklocation'),
        ),
        migrations.AddField(
            model_name='ridemodel',
            name='ride_type',
            field=models.CharField(blank=True, help_text="Specific ride type within the category (e.g., 'Flying Coaster', 'Inverted Coaster')", max_length=100),
        ),
        migrations.AddField(
            model_name='ridemodelevent',
            name='ride_type',
            field=models.CharField(blank=True, help_text="Specific ride type within the category (e.g., 'Flying Coaster', 'Inverted Coaster')", max_length=100),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name='company',
            trigger=pgtrigger.compiler.Trigger(name='insert_insert', sql=pgtrigger.compiler.UpsertTriggerSql(func='INSERT INTO "rides_companyevent" ("banner_image_id", "card_image_id", "coasters_count", "created_at", "description", "founded_date", "founded_date_precision", "founded_year", "headquarters_location", "id", "location_id", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rides_count", "roles", "slug", "updated_at", "url", "website") VALUES (NEW."banner_image_id", NEW."card_image_id", NEW."coasters_count", NEW."created_at", NEW."description", NEW."founded_date", NEW."founded_date_precision", NEW."founded_year", NEW."headquarters_location", NEW."id", NEW."location_id", NEW."name", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."rides_count", NEW."roles", NEW."slug", NEW."updated_at", NEW."url", NEW."website"); RETURN NULL;', hash='d1efc807d08a85e448a3294e70abb85e1c9c40ff', operation='INSERT', pgid='pgtrigger_insert_insert_e7194', table='rides_company', when='AFTER')),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name='company',
            trigger=pgtrigger.compiler.Trigger(name='update_update', sql=pgtrigger.compiler.UpsertTriggerSql(condition='WHEN (OLD.* IS DISTINCT FROM NEW.*)', func='INSERT INTO "rides_companyevent" ("banner_image_id", "card_image_id", "coasters_count", "created_at", "description", "founded_date", "founded_date_precision", "founded_year", "headquarters_location", "id", "location_id", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rides_count", "roles", "slug", "updated_at", "url", "website") VALUES (NEW."banner_image_id", NEW."card_image_id", NEW."coasters_count", NEW."created_at", NEW."description", NEW."founded_date", NEW."founded_date_precision", NEW."founded_year", NEW."headquarters_location", NEW."id", NEW."location_id", NEW."name", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."rides_count", NEW."roles", NEW."slug", NEW."updated_at", NEW."url", NEW."website"); RETURN NULL;', hash='dd4644183deefdfa27ec6d282c6da0c09d4df927', operation='UPDATE', pgid='pgtrigger_update_update_456a8', table='rides_company', when='AFTER')),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name='ridemodel',
            trigger=pgtrigger.compiler.Trigger(name='insert_insert', sql=pgtrigger.compiler.UpsertTriggerSql(func='INSERT INTO "rides_ridemodelevent" ("category", "created_at", "description", "first_installation_year", "id", "is_discontinued", "last_installation_year", "manufacturer_id", "meta_description", "meta_title", "name", "notable_features", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "primary_image_id", "restraint_system", "ride_type", "slug", "support_structure", "target_market", "total_installations", "track_type", "train_configuration", "typical_capacity_range_max", "typical_capacity_range_min", "typical_height_range_max_ft", "typical_height_range_min_ft", "typical_speed_range_max_mph", "typical_speed_range_min_mph", "updated_at", "url") VALUES (NEW."category", NEW."created_at", NEW."description", NEW."first_installation_year", NEW."id", NEW."is_discontinued", NEW."last_installation_year", NEW."manufacturer_id", NEW."meta_description", NEW."meta_title", NEW."name", NEW."notable_features", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."primary_image_id", NEW."restraint_system", NEW."ride_type", NEW."slug", NEW."support_structure", NEW."target_market", NEW."total_installations", NEW."track_type", NEW."train_configuration", NEW."typical_capacity_range_max", NEW."typical_capacity_range_min", NEW."typical_height_range_max_ft", NEW."typical_height_range_min_ft", NEW."typical_speed_range_max_mph", NEW."typical_speed_range_min_mph", NEW."updated_at", NEW."url"); RETURN NULL;', hash='715219f75d39aa2d59ffe836084dab943a322c5f', operation='INSERT', pgid='pgtrigger_insert_insert_0aaee', table='rides_ridemodel', when='AFTER')),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name='ridemodel',
            trigger=pgtrigger.compiler.Trigger(name='update_update', sql=pgtrigger.compiler.UpsertTriggerSql(condition='WHEN (OLD.* IS DISTINCT FROM NEW.*)', func='INSERT INTO "rides_ridemodelevent" ("category", "created_at", "description", "first_installation_year", "id", "is_discontinued", "last_installation_year", "manufacturer_id", "meta_description", "meta_title", "name", "notable_features", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "primary_image_id", "restraint_system", "ride_type", "slug", "support_structure", "target_market", "total_installations", "track_type", "train_configuration", "typical_capacity_range_max", "typical_capacity_range_min", "typical_height_range_max_ft", "typical_height_range_min_ft", "typical_speed_range_max_mph", "typical_speed_range_min_mph", "updated_at", "url") VALUES (NEW."category", NEW."created_at", NEW."description", NEW."first_installation_year", NEW."id", NEW."is_discontinued", NEW."last_installation_year", NEW."manufacturer_id", NEW."meta_description", NEW."meta_title", NEW."name", NEW."notable_features", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."primary_image_id", NEW."restraint_system", NEW."ride_type", NEW."slug", NEW."support_structure", NEW."target_market", NEW."total_installations", NEW."track_type", NEW."train_configuration", NEW."typical_capacity_range_max", NEW."typical_capacity_range_min", NEW."typical_height_range_max_ft", NEW."typical_height_range_min_ft", NEW."typical_speed_range_max_mph", NEW."typical_speed_range_min_mph", NEW."updated_at", NEW."url"); RETURN NULL;', hash='4f1d59b4ef9ddd207f7e4a56843d830ab67cff38', operation='UPDATE', pgid='pgtrigger_update_update_0ca1a', table='rides_ridemodel', when='AFTER')),
        ),
    ]
