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

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


class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0015_loginhistory_loginhistoryevent_and_more'),
    ]

    operations = [
        pgtrigger.migrations.RemoveTrigger(
            model_name='emailverification',
            name='insert_insert',
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name='emailverification',
            name='update_update',
        ),
        migrations.AddField(
            model_name='emailverification',
            name='updated_at',
            field=models.DateTimeField(auto_now=True, help_text='When this verification was last updated'),
        ),
        migrations.AddField(
            model_name='emailverificationevent',
            name='updated_at',
            field=models.DateTimeField(auto_now=True, help_text='When this verification was last updated'),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name='emailverification',
            trigger=pgtrigger.compiler.Trigger(name='insert_insert', sql=pgtrigger.compiler.UpsertTriggerSql(func='INSERT INTO "accounts_emailverificationevent" ("created_at", "id", "last_sent", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "token", "updated_at", "user_id") VALUES (NEW."created_at", NEW."id", NEW."last_sent", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."token", NEW."updated_at", NEW."user_id"); RETURN NULL;', hash='53c568e932b1b55a3c79e79220e6d6f269458003', operation='INSERT', pgid='pgtrigger_insert_insert_53748', table='accounts_emailverification', when='AFTER')),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name='emailverification',
            trigger=pgtrigger.compiler.Trigger(name='update_update', sql=pgtrigger.compiler.UpsertTriggerSql(condition='WHEN (OLD.* IS DISTINCT FROM NEW.*)', func='INSERT INTO "accounts_emailverificationevent" ("created_at", "id", "last_sent", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "token", "updated_at", "user_id") VALUES (NEW."created_at", NEW."id", NEW."last_sent", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."token", NEW."updated_at", NEW."user_id"); RETURN NULL;', hash='8b45a9a0a1810564cb46c098552ab4ec7920daeb', operation='UPDATE', pgid='pgtrigger_update_update_7a2a8', table='accounts_emailverification', when='AFTER')),
        ),
    ]
