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

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


class Migration(migrations.Migration):

    dependencies = [
        ('rides', '0037_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='is_test_data',
            field=models.BooleanField(default=False, help_text='Whether this is test/development data'),
        ),
        migrations.AddField(
            model_name='company',
            name='source_url',
            field=models.URLField(blank=True, help_text='Source URL for the data (e.g., official website, Wikipedia)'),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='is_test_data',
            field=models.BooleanField(default=False, help_text='Whether this is test/development data'),
        ),
        migrations.AddField(
            model_name='companyevent',
            name='source_url',
            field=models.URLField(blank=True, help_text='Source URL for the data (e.g., official website, Wikipedia)'),
        ),
        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", "is_test_data", "location_id", "name", "person_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rides_count", "roles", "slug", "source_url", "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."is_test_data", NEW."location_id", NEW."name", NEW."person_type", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."rides_count", NEW."roles", NEW."slug", NEW."source_url", NEW."updated_at", NEW."url", NEW."website"); RETURN NULL;', hash='26c30b4bcabc0661de7627f32a6b12d2ea9895ac', 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", "is_test_data", "location_id", "name", "person_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rides_count", "roles", "slug", "source_url", "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."is_test_data", NEW."location_id", NEW."name", NEW."person_type", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."rides_count", NEW."roles", NEW."slug", NEW."source_url", NEW."updated_at", NEW."url", NEW."website"); RETURN NULL;', hash='211e480aa3391c67288564ec1fdfa2552956bbba', operation='UPDATE', pgid='pgtrigger_update_update_456a8', table='rides_company', when='AFTER')),
        ),
    ]
