# Generated by Django 5.2.5 on 2025-08-30 20:55

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


class Migration(migrations.Migration):

    dependencies = [
        ("accounts", "0008_remove_first_last_name_fields"),
        ("contenttypes", "0002_remove_content_type_name"),
        ("django_cloudflareimages_toolkit", "0001_initial"),
        ("pghistory", "0006_delete_aggregateevent"),
    ]

    operations = [
        migrations.CreateModel(
            name="NotificationPreference",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("submission_approved_email", models.BooleanField(default=True)),
                ("submission_approved_push", models.BooleanField(default=True)),
                ("submission_approved_inapp", models.BooleanField(default=True)),
                ("submission_rejected_email", models.BooleanField(default=True)),
                ("submission_rejected_push", models.BooleanField(default=True)),
                ("submission_rejected_inapp", models.BooleanField(default=True)),
                ("submission_pending_email", models.BooleanField(default=False)),
                ("submission_pending_push", models.BooleanField(default=False)),
                ("submission_pending_inapp", models.BooleanField(default=True)),
                ("review_reply_email", models.BooleanField(default=True)),
                ("review_reply_push", models.BooleanField(default=True)),
                ("review_reply_inapp", models.BooleanField(default=True)),
                ("review_helpful_email", models.BooleanField(default=False)),
                ("review_helpful_push", models.BooleanField(default=True)),
                ("review_helpful_inapp", models.BooleanField(default=True)),
                ("friend_request_email", models.BooleanField(default=True)),
                ("friend_request_push", models.BooleanField(default=True)),
                ("friend_request_inapp", models.BooleanField(default=True)),
                ("friend_accepted_email", models.BooleanField(default=False)),
                ("friend_accepted_push", models.BooleanField(default=True)),
                ("friend_accepted_inapp", models.BooleanField(default=True)),
                ("message_received_email", models.BooleanField(default=True)),
                ("message_received_push", models.BooleanField(default=True)),
                ("message_received_inapp", models.BooleanField(default=True)),
                ("system_announcement_email", models.BooleanField(default=True)),
                ("system_announcement_push", models.BooleanField(default=False)),
                ("system_announcement_inapp", models.BooleanField(default=True)),
                ("account_security_email", models.BooleanField(default=True)),
                ("account_security_push", models.BooleanField(default=True)),
                ("account_security_inapp", models.BooleanField(default=True)),
                ("feature_update_email", models.BooleanField(default=True)),
                ("feature_update_push", models.BooleanField(default=False)),
                ("feature_update_inapp", models.BooleanField(default=True)),
                ("achievement_unlocked_email", models.BooleanField(default=False)),
                ("achievement_unlocked_push", models.BooleanField(default=True)),
                ("achievement_unlocked_inapp", models.BooleanField(default=True)),
                ("milestone_reached_email", models.BooleanField(default=False)),
                ("milestone_reached_push", models.BooleanField(default=True)),
                ("milestone_reached_inapp", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Notification Preference",
                "verbose_name_plural": "Notification Preferences",
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="NotificationPreferenceEvent",
            fields=[
                ("pgh_id", models.AutoField(primary_key=True, serialize=False)),
                ("pgh_created_at", models.DateTimeField(auto_now_add=True)),
                ("pgh_label", models.TextField(help_text="The event label.")),
                ("id", models.BigIntegerField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("submission_approved_email", models.BooleanField(default=True)),
                ("submission_approved_push", models.BooleanField(default=True)),
                ("submission_approved_inapp", models.BooleanField(default=True)),
                ("submission_rejected_email", models.BooleanField(default=True)),
                ("submission_rejected_push", models.BooleanField(default=True)),
                ("submission_rejected_inapp", models.BooleanField(default=True)),
                ("submission_pending_email", models.BooleanField(default=False)),
                ("submission_pending_push", models.BooleanField(default=False)),
                ("submission_pending_inapp", models.BooleanField(default=True)),
                ("review_reply_email", models.BooleanField(default=True)),
                ("review_reply_push", models.BooleanField(default=True)),
                ("review_reply_inapp", models.BooleanField(default=True)),
                ("review_helpful_email", models.BooleanField(default=False)),
                ("review_helpful_push", models.BooleanField(default=True)),
                ("review_helpful_inapp", models.BooleanField(default=True)),
                ("friend_request_email", models.BooleanField(default=True)),
                ("friend_request_push", models.BooleanField(default=True)),
                ("friend_request_inapp", models.BooleanField(default=True)),
                ("friend_accepted_email", models.BooleanField(default=False)),
                ("friend_accepted_push", models.BooleanField(default=True)),
                ("friend_accepted_inapp", models.BooleanField(default=True)),
                ("message_received_email", models.BooleanField(default=True)),
                ("message_received_push", models.BooleanField(default=True)),
                ("message_received_inapp", models.BooleanField(default=True)),
                ("system_announcement_email", models.BooleanField(default=True)),
                ("system_announcement_push", models.BooleanField(default=False)),
                ("system_announcement_inapp", models.BooleanField(default=True)),
                ("account_security_email", models.BooleanField(default=True)),
                ("account_security_push", models.BooleanField(default=True)),
                ("account_security_inapp", models.BooleanField(default=True)),
                ("feature_update_email", models.BooleanField(default=True)),
                ("feature_update_push", models.BooleanField(default=False)),
                ("feature_update_inapp", models.BooleanField(default=True)),
                ("achievement_unlocked_email", models.BooleanField(default=False)),
                ("achievement_unlocked_push", models.BooleanField(default=True)),
                ("achievement_unlocked_inapp", models.BooleanField(default=True)),
                ("milestone_reached_email", models.BooleanField(default=False)),
                ("milestone_reached_push", models.BooleanField(default=True)),
                ("milestone_reached_inapp", models.BooleanField(default=True)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="UserNotification",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "notification_type",
                    models.CharField(
                        choices=[
                            ("submission_approved", "Submission Approved"),
                            ("submission_rejected", "Submission Rejected"),
                            ("submission_pending", "Submission Pending Review"),
                            ("review_reply", "Review Reply"),
                            ("review_helpful", "Review Marked Helpful"),
                            ("friend_request", "Friend Request"),
                            ("friend_accepted", "Friend Request Accepted"),
                            ("message_received", "Message Received"),
                            ("profile_comment", "Profile Comment"),
                            ("system_announcement", "System Announcement"),
                            ("account_security", "Account Security"),
                            ("feature_update", "Feature Update"),
                            ("maintenance", "Maintenance Notice"),
                            ("achievement_unlocked", "Achievement Unlocked"),
                            ("milestone_reached", "Milestone Reached"),
                        ],
                        max_length=30,
                    ),
                ),
                ("title", models.CharField(max_length=200)),
                ("message", models.TextField()),
                ("object_id", models.PositiveIntegerField(blank=True, null=True)),
                (
                    "priority",
                    models.CharField(
                        choices=[
                            ("low", "Low"),
                            ("normal", "Normal"),
                            ("high", "High"),
                            ("urgent", "Urgent"),
                        ],
                        default="normal",
                        max_length=10,
                    ),
                ),
                ("is_read", models.BooleanField(default=False)),
                ("read_at", models.DateTimeField(blank=True, null=True)),
                ("email_sent", models.BooleanField(default=False)),
                ("email_sent_at", models.DateTimeField(blank=True, null=True)),
                ("push_sent", models.BooleanField(default=False)),
                ("push_sent_at", models.DateTimeField(blank=True, null=True)),
                ("extra_data", models.JSONField(blank=True, default=dict)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("expires_at", models.DateTimeField(blank=True, null=True)),
            ],
            options={
                "ordering": ["-created_at"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="UserNotificationEvent",
            fields=[
                ("pgh_id", models.AutoField(primary_key=True, serialize=False)),
                ("pgh_created_at", models.DateTimeField(auto_now_add=True)),
                ("pgh_label", models.TextField(help_text="The event label.")),
                ("id", models.BigIntegerField()),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "notification_type",
                    models.CharField(
                        choices=[
                            ("submission_approved", "Submission Approved"),
                            ("submission_rejected", "Submission Rejected"),
                            ("submission_pending", "Submission Pending Review"),
                            ("review_reply", "Review Reply"),
                            ("review_helpful", "Review Marked Helpful"),
                            ("friend_request", "Friend Request"),
                            ("friend_accepted", "Friend Request Accepted"),
                            ("message_received", "Message Received"),
                            ("profile_comment", "Profile Comment"),
                            ("system_announcement", "System Announcement"),
                            ("account_security", "Account Security"),
                            ("feature_update", "Feature Update"),
                            ("maintenance", "Maintenance Notice"),
                            ("achievement_unlocked", "Achievement Unlocked"),
                            ("milestone_reached", "Milestone Reached"),
                        ],
                        max_length=30,
                    ),
                ),
                ("title", models.CharField(max_length=200)),
                ("message", models.TextField()),
                ("object_id", models.PositiveIntegerField(blank=True, null=True)),
                (
                    "priority",
                    models.CharField(
                        choices=[
                            ("low", "Low"),
                            ("normal", "Normal"),
                            ("high", "High"),
                            ("urgent", "Urgent"),
                        ],
                        default="normal",
                        max_length=10,
                    ),
                ),
                ("is_read", models.BooleanField(default=False)),
                ("read_at", models.DateTimeField(blank=True, null=True)),
                ("email_sent", models.BooleanField(default=False)),
                ("email_sent_at", models.DateTimeField(blank=True, null=True)),
                ("push_sent", models.BooleanField(default=False)),
                ("push_sent_at", models.DateTimeField(blank=True, null=True)),
                ("extra_data", models.JSONField(blank=True, default=dict)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("expires_at", models.DateTimeField(blank=True, null=True)),
            ],
            options={
                "abstract": False,
            },
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name="userprofile",
            name="insert_insert",
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name="userprofile",
            name="update_update",
        ),
        migrations.AlterField(
            model_name="userprofile",
            name="avatar",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="django_cloudflareimages_toolkit.cloudflareimage",
            ),
        ),
        migrations.AlterField(
            model_name="userprofileevent",
            name="avatar",
            field=models.ForeignKey(
                blank=True,
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                related_query_name="+",
                to="django_cloudflareimages_toolkit.cloudflareimage",
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="userprofile",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "accounts_userprofileevent" ("avatar_id", "bio", "coaster_credits", "dark_ride_credits", "discord", "display_name", "flat_ride_credits", "id", "instagram", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "profile_id", "pronouns", "twitter", "user_id", "water_ride_credits", "youtube") VALUES (NEW."avatar_id", NEW."bio", NEW."coaster_credits", NEW."dark_ride_credits", NEW."discord", NEW."display_name", NEW."flat_ride_credits", NEW."id", NEW."instagram", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."profile_id", NEW."pronouns", NEW."twitter", NEW."user_id", NEW."water_ride_credits", NEW."youtube"); RETURN NULL;',
                    hash="a7ecdb1ac2821dea1fef4ec917eeaf6b8e4f09c8",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_c09d7",
                    table="accounts_userprofile",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="userprofile",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "accounts_userprofileevent" ("avatar_id", "bio", "coaster_credits", "dark_ride_credits", "discord", "display_name", "flat_ride_credits", "id", "instagram", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "profile_id", "pronouns", "twitter", "user_id", "water_ride_credits", "youtube") VALUES (NEW."avatar_id", NEW."bio", NEW."coaster_credits", NEW."dark_ride_credits", NEW."discord", NEW."display_name", NEW."flat_ride_credits", NEW."id", NEW."instagram", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."profile_id", NEW."pronouns", NEW."twitter", NEW."user_id", NEW."water_ride_credits", NEW."youtube"); RETURN NULL;',
                    hash="81607e492ffea2a4c741452b860ee660374cc01d",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_87ef6",
                    table="accounts_userprofile",
                    when="AFTER",
                ),
            ),
        ),
        migrations.AddField(
            model_name="notificationpreference",
            name="user",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="notification_preference",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="notificationpreferenceevent",
            name="pgh_context",
            field=models.ForeignKey(
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                to="pghistory.context",
            ),
        ),
        migrations.AddField(
            model_name="notificationpreferenceevent",
            name="pgh_obj",
            field=models.ForeignKey(
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="events",
                to="accounts.notificationpreference",
            ),
        ),
        migrations.AddField(
            model_name="notificationpreferenceevent",
            name="user",
            field=models.ForeignKey(
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                related_query_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="usernotification",
            name="content_type",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="contenttypes.contenttype",
            ),
        ),
        migrations.AddField(
            model_name="usernotification",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="notifications",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="usernotificationevent",
            name="content_type",
            field=models.ForeignKey(
                blank=True,
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                related_query_name="+",
                to="contenttypes.contenttype",
            ),
        ),
        migrations.AddField(
            model_name="usernotificationevent",
            name="pgh_context",
            field=models.ForeignKey(
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                to="pghistory.context",
            ),
        ),
        migrations.AddField(
            model_name="usernotificationevent",
            name="pgh_obj",
            field=models.ForeignKey(
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="events",
                to="accounts.usernotification",
            ),
        ),
        migrations.AddField(
            model_name="usernotificationevent",
            name="user",
            field=models.ForeignKey(
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                related_query_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="notificationpreference",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "accounts_notificationpreferenceevent" ("account_security_email", "account_security_inapp", "account_security_push", "achievement_unlocked_email", "achievement_unlocked_inapp", "achievement_unlocked_push", "created_at", "feature_update_email", "feature_update_inapp", "feature_update_push", "friend_accepted_email", "friend_accepted_inapp", "friend_accepted_push", "friend_request_email", "friend_request_inapp", "friend_request_push", "id", "message_received_email", "message_received_inapp", "message_received_push", "milestone_reached_email", "milestone_reached_inapp", "milestone_reached_push", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "review_helpful_email", "review_helpful_inapp", "review_helpful_push", "review_reply_email", "review_reply_inapp", "review_reply_push", "submission_approved_email", "submission_approved_inapp", "submission_approved_push", "submission_pending_email", "submission_pending_inapp", "submission_pending_push", "submission_rejected_email", "submission_rejected_inapp", "submission_rejected_push", "system_announcement_email", "system_announcement_inapp", "system_announcement_push", "updated_at", "user_id") VALUES (NEW."account_security_email", NEW."account_security_inapp", NEW."account_security_push", NEW."achievement_unlocked_email", NEW."achievement_unlocked_inapp", NEW."achievement_unlocked_push", NEW."created_at", NEW."feature_update_email", NEW."feature_update_inapp", NEW."feature_update_push", NEW."friend_accepted_email", NEW."friend_accepted_inapp", NEW."friend_accepted_push", NEW."friend_request_email", NEW."friend_request_inapp", NEW."friend_request_push", NEW."id", NEW."message_received_email", NEW."message_received_inapp", NEW."message_received_push", NEW."milestone_reached_email", NEW."milestone_reached_inapp", NEW."milestone_reached_push", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."review_helpful_email", NEW."review_helpful_inapp", NEW."review_helpful_push", NEW."review_reply_email", NEW."review_reply_inapp", NEW."review_reply_push", NEW."submission_approved_email", NEW."submission_approved_inapp", NEW."submission_approved_push", NEW."submission_pending_email", NEW."submission_pending_inapp", NEW."submission_pending_push", NEW."submission_rejected_email", NEW."submission_rejected_inapp", NEW."submission_rejected_push", NEW."system_announcement_email", NEW."system_announcement_inapp", NEW."system_announcement_push", NEW."updated_at", NEW."user_id"); RETURN NULL;',
                    hash="bbaa03794722dab95c97ed93731d8b55f314dbdc",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_4a06b",
                    table="accounts_notificationpreference",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="notificationpreference",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "accounts_notificationpreferenceevent" ("account_security_email", "account_security_inapp", "account_security_push", "achievement_unlocked_email", "achievement_unlocked_inapp", "achievement_unlocked_push", "created_at", "feature_update_email", "feature_update_inapp", "feature_update_push", "friend_accepted_email", "friend_accepted_inapp", "friend_accepted_push", "friend_request_email", "friend_request_inapp", "friend_request_push", "id", "message_received_email", "message_received_inapp", "message_received_push", "milestone_reached_email", "milestone_reached_inapp", "milestone_reached_push", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "review_helpful_email", "review_helpful_inapp", "review_helpful_push", "review_reply_email", "review_reply_inapp", "review_reply_push", "submission_approved_email", "submission_approved_inapp", "submission_approved_push", "submission_pending_email", "submission_pending_inapp", "submission_pending_push", "submission_rejected_email", "submission_rejected_inapp", "submission_rejected_push", "system_announcement_email", "system_announcement_inapp", "system_announcement_push", "updated_at", "user_id") VALUES (NEW."account_security_email", NEW."account_security_inapp", NEW."account_security_push", NEW."achievement_unlocked_email", NEW."achievement_unlocked_inapp", NEW."achievement_unlocked_push", NEW."created_at", NEW."feature_update_email", NEW."feature_update_inapp", NEW."feature_update_push", NEW."friend_accepted_email", NEW."friend_accepted_inapp", NEW."friend_accepted_push", NEW."friend_request_email", NEW."friend_request_inapp", NEW."friend_request_push", NEW."id", NEW."message_received_email", NEW."message_received_inapp", NEW."message_received_push", NEW."milestone_reached_email", NEW."milestone_reached_inapp", NEW."milestone_reached_push", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."review_helpful_email", NEW."review_helpful_inapp", NEW."review_helpful_push", NEW."review_reply_email", NEW."review_reply_inapp", NEW."review_reply_push", NEW."submission_approved_email", NEW."submission_approved_inapp", NEW."submission_approved_push", NEW."submission_pending_email", NEW."submission_pending_inapp", NEW."submission_pending_push", NEW."submission_rejected_email", NEW."submission_rejected_inapp", NEW."submission_rejected_push", NEW."system_announcement_email", NEW."system_announcement_inapp", NEW."system_announcement_push", NEW."updated_at", NEW."user_id"); RETURN NULL;',
                    hash="0de72b66f87f795aaeb49be8e4e57d632781bd3a",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_d3fc0",
                    table="accounts_notificationpreference",
                    when="AFTER",
                ),
            ),
        ),
        migrations.AddIndex(
            model_name="usernotification",
            index=models.Index(fields=["user", "is_read"], name="accounts_us_user_id_785929_idx"),
        ),
        migrations.AddIndex(
            model_name="usernotification",
            index=models.Index(
                fields=["user", "notification_type"],
                name="accounts_us_user_id_8cea97_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="usernotification",
            index=models.Index(fields=["created_at"], name="accounts_us_created_a62f54_idx"),
        ),
        migrations.AddIndex(
            model_name="usernotification",
            index=models.Index(fields=["expires_at"], name="accounts_us_expires_f267b1_idx"),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="usernotification",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "accounts_usernotificationevent" ("content_type_id", "created_at", "email_sent", "email_sent_at", "expires_at", "extra_data", "id", "is_read", "message", "notification_type", "object_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "priority", "push_sent", "push_sent_at", "read_at", "title", "updated_at", "user_id") VALUES (NEW."content_type_id", NEW."created_at", NEW."email_sent", NEW."email_sent_at", NEW."expires_at", NEW."extra_data", NEW."id", NEW."is_read", NEW."message", NEW."notification_type", NEW."object_id", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."priority", NEW."push_sent", NEW."push_sent_at", NEW."read_at", NEW."title", NEW."updated_at", NEW."user_id"); RETURN NULL;',
                    hash="822a189e675a5903841d19738c29aa94267417f1",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_2794b",
                    table="accounts_usernotification",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="usernotification",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "accounts_usernotificationevent" ("content_type_id", "created_at", "email_sent", "email_sent_at", "expires_at", "extra_data", "id", "is_read", "message", "notification_type", "object_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "priority", "push_sent", "push_sent_at", "read_at", "title", "updated_at", "user_id") VALUES (NEW."content_type_id", NEW."created_at", NEW."email_sent", NEW."email_sent_at", NEW."expires_at", NEW."extra_data", NEW."id", NEW."is_read", NEW."message", NEW."notification_type", NEW."object_id", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."priority", NEW."push_sent", NEW."push_sent_at", NEW."read_at", NEW."title", NEW."updated_at", NEW."user_id"); RETURN NULL;',
                    hash="1fd24a77684747bd9a521447a2978529085b6c07",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_15c54",
                    table="accounts_usernotification",
                    when="AFTER",
                ),
            ),
        ),
    ]
