# Generated by Django 5.2.9 on 2026-01-08 18:20

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


class Migration(migrations.Migration):

    dependencies = [
        ('parks', '0029_add_source_url_is_test_data_and_date_precision'),
    ]

    operations = [
        pgtrigger.migrations.RemoveTrigger(
            model_name='company',
            name='insert_insert',
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name='company',
            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='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_hq', 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='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'),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name='company',
            trigger=pgtrigger.compiler.Trigger(name='insert_insert', sql=pgtrigger.compiler.UpsertTriggerSql(func='INSERT INTO "parks_companyevent" ("average_rating", "banner_image_id", "banner_image_url", "card_image_id", "card_image_url", "created_at", "description", "founded_date", "founded_date_precision", "founded_year", "headquarters_location", "id", "is_test_data", "location_id", "logo_url", "name", "parks_count", "person_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "review_count", "rides_count", "roles", "slug", "source_url", "status", "updated_at", "website") VALUES (NEW."average_rating", NEW."banner_image_id", NEW."banner_image_url", NEW."card_image_id", NEW."card_image_url", NEW."created_at", NEW."description", NEW."founded_date", NEW."founded_date_precision", NEW."founded_year", NEW."headquarters_location", NEW."id", NEW."is_test_data", NEW."location_id", NEW."logo_url", NEW."name", NEW."parks_count", NEW."person_type", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."review_count", NEW."rides_count", NEW."roles", NEW."slug", NEW."source_url", NEW."status", NEW."updated_at", NEW."website"); RETURN NULL;', hash='9e3f8a98696e2655ada53342a59b11a71bfa384c', operation='INSERT', pgid='pgtrigger_insert_insert_35b57', table='parks_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 "parks_companyevent" ("average_rating", "banner_image_id", "banner_image_url", "card_image_id", "card_image_url", "created_at", "description", "founded_date", "founded_date_precision", "founded_year", "headquarters_location", "id", "is_test_data", "location_id", "logo_url", "name", "parks_count", "person_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "review_count", "rides_count", "roles", "slug", "source_url", "status", "updated_at", "website") VALUES (NEW."average_rating", NEW."banner_image_id", NEW."banner_image_url", NEW."card_image_id", NEW."card_image_url", NEW."created_at", NEW."description", NEW."founded_date", NEW."founded_date_precision", NEW."founded_year", NEW."headquarters_location", NEW."id", NEW."is_test_data", NEW."location_id", NEW."logo_url", NEW."name", NEW."parks_count", NEW."person_type", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."review_count", NEW."rides_count", NEW."roles", NEW."slug", NEW."source_url", NEW."status", NEW."updated_at", NEW."website"); RETURN NULL;', hash='953a919e1969082370e189b0b47a2ce3fc9dafcf', operation='UPDATE', pgid='pgtrigger_update_update_d3286', table='parks_company', when='AFTER')),
        ),
    ]
