# Generated by Django 3.2.12 on 2023-05-16 11:51

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


class Migration(migrations.Migration):

    dependencies = [
        ('pgpubsub', '0003_notification_db_version'),
    ]

    operations = [
        pgtrigger.migrations.AddTrigger(
            model_name='notification',
            trigger=pgtrigger.compiler.Trigger(name='pgpubsub_notification_set_db_version', sql=pgtrigger.compiler.UpsertTriggerSql(func="\n                    NEW.db_version := (\n                        SELECT max(id)\n                        FROM django_migrations\n                        WHERE app = ((NEW.payload #>> '{}')::jsonb ->> 'app')\n                    );\n                    NEW.created_at := NOW();\n                    RETURN NEW;\n                ", hash='e04fb736d4f2f3925f3756bd31d0771aa16d4b6f', operation='INSERT', pgid='pgtrigger_pgpubsub_notification_set_db_version_ac4cd', table='pgpubsub_notification', when='BEFORE')),
        ),
    ]
