# Generated by Django 5.2.5 on 2025-08-29 15:10

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


class Migration(migrations.Migration):

    dependencies = [
        ("accounts", "0004_userdeletionrequest_userdeletionrequestevent_and_more"),
    ]

    operations = [
        pgtrigger.migrations.RemoveTrigger(
            model_name="user",
            name="insert_insert",
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name="user",
            name="update_update",
        ),
        migrations.AddField(
            model_name="user",
            name="activity_visibility",
            field=models.CharField(
                choices=[
                    ("public", "Public"),
                    ("friends", "Friends Only"),
                    ("private", "Private"),
                ],
                default="friends",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="user",
            name="allow_friend_requests",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="allow_messages",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="allow_profile_comments",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="user",
            name="email_notifications",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="last_password_change",
            field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="user",
            name="login_history_retention",
            field=models.IntegerField(default=90),
        ),
        migrations.AddField(
            model_name="user",
            name="login_notifications",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="notification_preferences",
            field=models.JSONField(
                blank=True,
                default=dict,
                help_text="Detailed notification preferences stored as JSON",
            ),
        ),
        migrations.AddField(
            model_name="user",
            name="privacy_level",
            field=models.CharField(
                choices=[
                    ("public", "Public"),
                    ("friends", "Friends Only"),
                    ("private", "Private"),
                ],
                default="public",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="user",
            name="push_notifications",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="user",
            name="search_visibility",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="session_timeout",
            field=models.IntegerField(default=30),
        ),
        migrations.AddField(
            model_name="user",
            name="show_email",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="user",
            name="show_join_date",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="show_photos",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="show_real_name",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="show_reviews",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="show_statistics",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="show_top_lists",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="user",
            name="two_factor_enabled",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="userevent",
            name="activity_visibility",
            field=models.CharField(
                choices=[
                    ("public", "Public"),
                    ("friends", "Friends Only"),
                    ("private", "Private"),
                ],
                default="friends",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="userevent",
            name="allow_friend_requests",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="allow_messages",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="allow_profile_comments",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="userevent",
            name="email_notifications",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="last_password_change",
            field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="userevent",
            name="login_history_retention",
            field=models.IntegerField(default=90),
        ),
        migrations.AddField(
            model_name="userevent",
            name="login_notifications",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="notification_preferences",
            field=models.JSONField(
                blank=True,
                default=dict,
                help_text="Detailed notification preferences stored as JSON",
            ),
        ),
        migrations.AddField(
            model_name="userevent",
            name="privacy_level",
            field=models.CharField(
                choices=[
                    ("public", "Public"),
                    ("friends", "Friends Only"),
                    ("private", "Private"),
                ],
                default="public",
                max_length=10,
            ),
        ),
        migrations.AddField(
            model_name="userevent",
            name="push_notifications",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="userevent",
            name="search_visibility",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="session_timeout",
            field=models.IntegerField(default=30),
        ),
        migrations.AddField(
            model_name="userevent",
            name="show_email",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="userevent",
            name="show_join_date",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="show_photos",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="show_real_name",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="show_reviews",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="show_statistics",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="show_top_lists",
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name="userevent",
            name="two_factor_enabled",
            field=models.BooleanField(default=False),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="user",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "accounts_userevent" ("activity_visibility", "allow_friend_requests", "allow_messages", "allow_profile_comments", "ban_date", "ban_reason", "date_joined", "email", "email_notifications", "first_name", "id", "is_active", "is_banned", "is_staff", "is_superuser", "last_login", "last_name", "last_password_change", "login_history_retention", "login_notifications", "notification_preferences", "password", "pending_email", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "privacy_level", "push_notifications", "role", "search_visibility", "session_timeout", "show_email", "show_join_date", "show_photos", "show_real_name", "show_reviews", "show_statistics", "show_top_lists", "theme_preference", "two_factor_enabled", "user_id", "username") VALUES (NEW."activity_visibility", NEW."allow_friend_requests", NEW."allow_messages", NEW."allow_profile_comments", NEW."ban_date", NEW."ban_reason", NEW."date_joined", NEW."email", NEW."email_notifications", NEW."first_name", NEW."id", NEW."is_active", NEW."is_banned", NEW."is_staff", NEW."is_superuser", NEW."last_login", NEW."last_name", NEW."last_password_change", NEW."login_history_retention", NEW."login_notifications", NEW."notification_preferences", NEW."password", NEW."pending_email", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."privacy_level", NEW."push_notifications", NEW."role", NEW."search_visibility", NEW."session_timeout", NEW."show_email", NEW."show_join_date", NEW."show_photos", NEW."show_real_name", NEW."show_reviews", NEW."show_statistics", NEW."show_top_lists", NEW."theme_preference", NEW."two_factor_enabled", NEW."user_id", NEW."username"); RETURN NULL;',
                    hash="63ede44a0db376d673078f3464edc89aa8ca80c7",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_3867c",
                    table="accounts_user",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="user",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "accounts_userevent" ("activity_visibility", "allow_friend_requests", "allow_messages", "allow_profile_comments", "ban_date", "ban_reason", "date_joined", "email", "email_notifications", "first_name", "id", "is_active", "is_banned", "is_staff", "is_superuser", "last_login", "last_name", "last_password_change", "login_history_retention", "login_notifications", "notification_preferences", "password", "pending_email", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "privacy_level", "push_notifications", "role", "search_visibility", "session_timeout", "show_email", "show_join_date", "show_photos", "show_real_name", "show_reviews", "show_statistics", "show_top_lists", "theme_preference", "two_factor_enabled", "user_id", "username") VALUES (NEW."activity_visibility", NEW."allow_friend_requests", NEW."allow_messages", NEW."allow_profile_comments", NEW."ban_date", NEW."ban_reason", NEW."date_joined", NEW."email", NEW."email_notifications", NEW."first_name", NEW."id", NEW."is_active", NEW."is_banned", NEW."is_staff", NEW."is_superuser", NEW."last_login", NEW."last_name", NEW."last_password_change", NEW."login_history_retention", NEW."login_notifications", NEW."notification_preferences", NEW."password", NEW."pending_email", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."privacy_level", NEW."push_notifications", NEW."role", NEW."search_visibility", NEW."session_timeout", NEW."show_email", NEW."show_join_date", NEW."show_photos", NEW."show_real_name", NEW."show_reviews", NEW."show_statistics", NEW."show_top_lists", NEW."theme_preference", NEW."two_factor_enabled", NEW."user_id", NEW."username"); RETURN NULL;',
                    hash="9157131b568edafe1e5fcdf313bfeaaa8adcfee4",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_0e890",
                    table="accounts_user",
                    when="AFTER",
                ),
            ),
        ),
    ]
