# Generated by Django 4.2.27 on 2026-01-16 08:20

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


class Migration(migrations.Migration):
    dependencies = [
        ("formkit_ninja", "0028_migrate_additional_props"),
    ]

    operations = [
        pgtrigger.migrations.RemoveTrigger(
            model_name="formkitschemanode",
            name="insert_insert",
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name="formkitschemanode",
            name="update_update",
        ),
        migrations.AddField(
            model_name="formkitschemanode",
            name="min",
            field=models.CharField(blank=True, max_length=256, null=True),
        ),
        migrations.AddField(
            model_name="formkitschemanode",
            name="readonly",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="formkitschemanode",
            name="sections_schema",
            field=models.JSONField(blank=True, help_text="Schema for the sections", null=True),
        ),
        migrations.AddField(
            model_name="formkitschemanodeevent",
            name="min",
            field=models.CharField(blank=True, max_length=256, null=True),
        ),
        migrations.AddField(
            model_name="formkitschemanodeevent",
            name="readonly",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="formkitschemanodeevent",
            name="sections_schema",
            field=models.JSONField(blank=True, help_text="Schema for the sections", null=True),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="formkitschemanode",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "formkit_ninja_formkitschemanodeevent" ("additional_props", "created", "created_by_id", "description", "icon", "id", "is_active", "label", "min", "node", "node_type", "option_group_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "protected", "readonly", "sections_schema", "text_content", "title", "track_change", "updated", "updated_by_id") VALUES (NEW."additional_props", NEW."created", NEW."created_by_id", NEW."description", NEW."icon", NEW."id", NEW."is_active", NEW."label", NEW."min", NEW."node", NEW."node_type", NEW."option_group_id", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."protected", NEW."readonly", NEW."sections_schema", NEW."text_content", NEW."title", NEW."track_change", NEW."updated", NEW."updated_by_id"); RETURN NULL;',
                    hash="bc5b626dec2fd5738a75d4dd970732e2ad718c6c",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_72c4c",
                    table="formkit_ninja_formkitschemanode",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="formkitschemanode",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "formkit_ninja_formkitschemanodeevent" ("additional_props", "created", "created_by_id", "description", "icon", "id", "is_active", "label", "min", "node", "node_type", "option_group_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "protected", "readonly", "sections_schema", "text_content", "title", "track_change", "updated", "updated_by_id") VALUES (NEW."additional_props", NEW."created", NEW."created_by_id", NEW."description", NEW."icon", NEW."id", NEW."is_active", NEW."label", NEW."min", NEW."node", NEW."node_type", NEW."option_group_id", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."protected", NEW."readonly", NEW."sections_schema", NEW."text_content", NEW."title", NEW."track_change", NEW."updated", NEW."updated_by_id"); RETURN NULL;',
                    hash="8dba73e11ffd459edd5b0337334ddf27ad48eb92",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_d7c99",
                    table="formkit_ninja_formkitschemanode",
                    when="AFTER",
                ),
            ),
        ),
    ]
