mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:11:08 -05:00
1524 lines
77 KiB
Python
1524 lines
77 KiB
Python
# Generated by Django 5.2.6 on 2025-09-21 01:29
|
|
|
|
import apps.core.choices.fields
|
|
import django.contrib.auth.models
|
|
import django.contrib.auth.validators
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
import pgtrigger.compiler
|
|
import pgtrigger.migrations
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
("auth", "0012_alter_user_first_name_max_length"),
|
|
("contenttypes", "0002_remove_content_type_name"),
|
|
("pghistory", "0007_auto_20250421_0444"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="User",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("password", models.CharField(max_length=128, verbose_name="password")),
|
|
(
|
|
"last_login",
|
|
models.DateTimeField(
|
|
blank=True, null=True, verbose_name="last login"
|
|
),
|
|
),
|
|
(
|
|
"is_superuser",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="Designates that this user has all permissions without explicitly assigning them.",
|
|
verbose_name="superuser status",
|
|
),
|
|
),
|
|
(
|
|
"username",
|
|
models.CharField(
|
|
error_messages={
|
|
"unique": "A user with that username already exists."
|
|
},
|
|
help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
|
|
max_length=150,
|
|
unique=True,
|
|
validators=[
|
|
django.contrib.auth.validators.UnicodeUsernameValidator()
|
|
],
|
|
verbose_name="username",
|
|
),
|
|
),
|
|
(
|
|
"email",
|
|
models.EmailField(
|
|
blank=True, max_length=254, verbose_name="email address"
|
|
),
|
|
),
|
|
(
|
|
"is_staff",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="Designates whether the user can log into this admin site.",
|
|
verbose_name="staff status",
|
|
),
|
|
),
|
|
(
|
|
"is_active",
|
|
models.BooleanField(
|
|
default=True,
|
|
help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
|
|
verbose_name="active",
|
|
),
|
|
),
|
|
(
|
|
"date_joined",
|
|
models.DateTimeField(
|
|
default=django.utils.timezone.now, verbose_name="date joined"
|
|
),
|
|
),
|
|
(
|
|
"user_id",
|
|
models.CharField(
|
|
editable=False,
|
|
help_text="Unique identifier for this user that remains constant even if the username changes",
|
|
max_length=10,
|
|
unique=True,
|
|
),
|
|
),
|
|
(
|
|
"role",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="user_roles",
|
|
choices=[
|
|
("USER", "User"),
|
|
("MODERATOR", "Moderator"),
|
|
("ADMIN", "Admin"),
|
|
("SUPERUSER", "Superuser"),
|
|
],
|
|
default="USER",
|
|
domain="accounts",
|
|
max_length=10,
|
|
),
|
|
),
|
|
("is_banned", models.BooleanField(default=False)),
|
|
("ban_reason", models.TextField(blank=True)),
|
|
("ban_date", models.DateTimeField(blank=True, null=True)),
|
|
(
|
|
"pending_email",
|
|
models.EmailField(blank=True, max_length=254, null=True),
|
|
),
|
|
(
|
|
"theme_preference",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="theme_preferences",
|
|
choices=[("light", "Light"), ("dark", "Dark")],
|
|
default="light",
|
|
domain="accounts",
|
|
max_length=5,
|
|
),
|
|
),
|
|
("email_notifications", models.BooleanField(default=True)),
|
|
("push_notifications", models.BooleanField(default=False)),
|
|
(
|
|
"privacy_level",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="privacy_levels",
|
|
choices=[
|
|
("public", "Public"),
|
|
("friends", "Friends Only"),
|
|
("private", "Private"),
|
|
],
|
|
default="public",
|
|
domain="accounts",
|
|
max_length=10,
|
|
),
|
|
),
|
|
("show_email", models.BooleanField(default=False)),
|
|
("show_real_name", models.BooleanField(default=True)),
|
|
("show_join_date", models.BooleanField(default=True)),
|
|
("show_statistics", models.BooleanField(default=True)),
|
|
("show_reviews", models.BooleanField(default=True)),
|
|
("show_photos", models.BooleanField(default=True)),
|
|
("show_top_lists", models.BooleanField(default=True)),
|
|
("allow_friend_requests", models.BooleanField(default=True)),
|
|
("allow_messages", models.BooleanField(default=True)),
|
|
("allow_profile_comments", models.BooleanField(default=False)),
|
|
("search_visibility", models.BooleanField(default=True)),
|
|
(
|
|
"activity_visibility",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="privacy_levels",
|
|
choices=[
|
|
("public", "Public"),
|
|
("friends", "Friends Only"),
|
|
("private", "Private"),
|
|
],
|
|
default="friends",
|
|
domain="accounts",
|
|
max_length=10,
|
|
),
|
|
),
|
|
("two_factor_enabled", models.BooleanField(default=False)),
|
|
("login_notifications", models.BooleanField(default=True)),
|
|
("session_timeout", models.IntegerField(default=30)),
|
|
("login_history_retention", models.IntegerField(default=90)),
|
|
("last_password_change", models.DateTimeField(auto_now_add=True)),
|
|
(
|
|
"display_name",
|
|
models.CharField(
|
|
blank=True,
|
|
help_text="Display name shown throughout the site. Falls back to username if not set.",
|
|
max_length=50,
|
|
),
|
|
),
|
|
(
|
|
"notification_preferences",
|
|
models.JSONField(
|
|
blank=True,
|
|
default=dict,
|
|
help_text="Detailed notification preferences stored as JSON",
|
|
),
|
|
),
|
|
(
|
|
"groups",
|
|
models.ManyToManyField(
|
|
blank=True,
|
|
help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
|
|
related_name="user_set",
|
|
related_query_name="user",
|
|
to="auth.group",
|
|
verbose_name="groups",
|
|
),
|
|
),
|
|
(
|
|
"user_permissions",
|
|
models.ManyToManyField(
|
|
blank=True,
|
|
help_text="Specific permissions for this user.",
|
|
related_name="user_set",
|
|
related_query_name="user",
|
|
to="auth.permission",
|
|
verbose_name="user permissions",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "user",
|
|
"verbose_name_plural": "users",
|
|
"abstract": False,
|
|
},
|
|
managers=[
|
|
("objects", django.contrib.auth.models.UserManager()),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="EmailVerification",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("token", models.CharField(max_length=64, unique=True)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("last_sent", models.DateTimeField(auto_now_add=True)),
|
|
(
|
|
"user",
|
|
models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Email Verification",
|
|
"verbose_name_plural": "Email Verifications",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="EmailVerificationEvent",
|
|
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()),
|
|
("token", models.CharField(max_length=64)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("last_sent", models.DateTimeField(auto_now_add=True)),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="accounts.emailverification",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
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)),
|
|
(
|
|
"user",
|
|
models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="notification_preference",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
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)),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="accounts.notificationpreference",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="PasswordReset",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("token", models.CharField(max_length=64)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("expires_at", models.DateTimeField()),
|
|
("used", models.BooleanField(default=False)),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Password Reset",
|
|
"verbose_name_plural": "Password Resets",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="PasswordResetEvent",
|
|
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()),
|
|
("token", models.CharField(max_length=64)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("expires_at", models.DateTimeField()),
|
|
("used", models.BooleanField(default=False)),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="accounts.passwordreset",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="TopList",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("title", models.CharField(max_length=100)),
|
|
(
|
|
"category",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="top_list_categories",
|
|
choices=[
|
|
("RC", "Roller Coaster"),
|
|
("DR", "Dark Ride"),
|
|
("FR", "Flat Ride"),
|
|
("WR", "Water Ride"),
|
|
("PK", "Park"),
|
|
],
|
|
domain="accounts",
|
|
max_length=2,
|
|
),
|
|
),
|
|
("description", models.TextField(blank=True)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="top_lists",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["-updated_at"],
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="TopListItem",
|
|
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)),
|
|
("object_id", models.PositiveIntegerField()),
|
|
("rank", models.PositiveIntegerField()),
|
|
("notes", models.TextField(blank=True)),
|
|
(
|
|
"content_type",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
to="contenttypes.contenttype",
|
|
),
|
|
),
|
|
(
|
|
"top_list",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="items",
|
|
to="accounts.toplist",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["rank"],
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserDeletionRequest",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"verification_code",
|
|
models.CharField(
|
|
help_text="Unique verification code sent to user's email",
|
|
max_length=32,
|
|
unique=True,
|
|
),
|
|
),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
(
|
|
"expires_at",
|
|
models.DateTimeField(
|
|
help_text="When this deletion request expires"
|
|
),
|
|
),
|
|
(
|
|
"email_sent_at",
|
|
models.DateTimeField(
|
|
blank=True,
|
|
help_text="When the verification email was sent",
|
|
null=True,
|
|
),
|
|
),
|
|
(
|
|
"attempts",
|
|
models.PositiveIntegerField(
|
|
default=0, help_text="Number of verification attempts made"
|
|
),
|
|
),
|
|
(
|
|
"max_attempts",
|
|
models.PositiveIntegerField(
|
|
default=5,
|
|
help_text="Maximum number of verification attempts allowed",
|
|
),
|
|
),
|
|
(
|
|
"is_used",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="Whether this deletion request has been used",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="deletion_request",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["-created_at"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserDeletionRequestEvent",
|
|
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()),
|
|
(
|
|
"verification_code",
|
|
models.CharField(
|
|
help_text="Unique verification code sent to user's email",
|
|
max_length=32,
|
|
),
|
|
),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
(
|
|
"expires_at",
|
|
models.DateTimeField(
|
|
help_text="When this deletion request expires"
|
|
),
|
|
),
|
|
(
|
|
"email_sent_at",
|
|
models.DateTimeField(
|
|
blank=True,
|
|
help_text="When the verification email was sent",
|
|
null=True,
|
|
),
|
|
),
|
|
(
|
|
"attempts",
|
|
models.PositiveIntegerField(
|
|
default=0, help_text="Number of verification attempts made"
|
|
),
|
|
),
|
|
(
|
|
"max_attempts",
|
|
models.PositiveIntegerField(
|
|
default=5,
|
|
help_text="Maximum number of verification attempts allowed",
|
|
),
|
|
),
|
|
(
|
|
"is_used",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="Whether this deletion request has been used",
|
|
),
|
|
),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="accounts.userdeletionrequest",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserEvent",
|
|
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()),
|
|
("password", models.CharField(max_length=128, verbose_name="password")),
|
|
(
|
|
"last_login",
|
|
models.DateTimeField(
|
|
blank=True, null=True, verbose_name="last login"
|
|
),
|
|
),
|
|
(
|
|
"is_superuser",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="Designates that this user has all permissions without explicitly assigning them.",
|
|
verbose_name="superuser status",
|
|
),
|
|
),
|
|
(
|
|
"username",
|
|
models.CharField(
|
|
error_messages={
|
|
"unique": "A user with that username already exists."
|
|
},
|
|
help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
|
|
max_length=150,
|
|
validators=[
|
|
django.contrib.auth.validators.UnicodeUsernameValidator()
|
|
],
|
|
verbose_name="username",
|
|
),
|
|
),
|
|
(
|
|
"email",
|
|
models.EmailField(
|
|
blank=True, max_length=254, verbose_name="email address"
|
|
),
|
|
),
|
|
(
|
|
"is_staff",
|
|
models.BooleanField(
|
|
default=False,
|
|
help_text="Designates whether the user can log into this admin site.",
|
|
verbose_name="staff status",
|
|
),
|
|
),
|
|
(
|
|
"is_active",
|
|
models.BooleanField(
|
|
default=True,
|
|
help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
|
|
verbose_name="active",
|
|
),
|
|
),
|
|
(
|
|
"date_joined",
|
|
models.DateTimeField(
|
|
default=django.utils.timezone.now, verbose_name="date joined"
|
|
),
|
|
),
|
|
(
|
|
"user_id",
|
|
models.CharField(
|
|
editable=False,
|
|
help_text="Unique identifier for this user that remains constant even if the username changes",
|
|
max_length=10,
|
|
),
|
|
),
|
|
(
|
|
"role",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="user_roles",
|
|
choices=[
|
|
("USER", "User"),
|
|
("MODERATOR", "Moderator"),
|
|
("ADMIN", "Admin"),
|
|
("SUPERUSER", "Superuser"),
|
|
],
|
|
default="USER",
|
|
domain="accounts",
|
|
max_length=10,
|
|
),
|
|
),
|
|
("is_banned", models.BooleanField(default=False)),
|
|
("ban_reason", models.TextField(blank=True)),
|
|
("ban_date", models.DateTimeField(blank=True, null=True)),
|
|
(
|
|
"pending_email",
|
|
models.EmailField(blank=True, max_length=254, null=True),
|
|
),
|
|
(
|
|
"theme_preference",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="theme_preferences",
|
|
choices=[("light", "Light"), ("dark", "Dark")],
|
|
default="light",
|
|
domain="accounts",
|
|
max_length=5,
|
|
),
|
|
),
|
|
("email_notifications", models.BooleanField(default=True)),
|
|
("push_notifications", models.BooleanField(default=False)),
|
|
(
|
|
"privacy_level",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="privacy_levels",
|
|
choices=[
|
|
("public", "Public"),
|
|
("friends", "Friends Only"),
|
|
("private", "Private"),
|
|
],
|
|
default="public",
|
|
domain="accounts",
|
|
max_length=10,
|
|
),
|
|
),
|
|
("show_email", models.BooleanField(default=False)),
|
|
("show_real_name", models.BooleanField(default=True)),
|
|
("show_join_date", models.BooleanField(default=True)),
|
|
("show_statistics", models.BooleanField(default=True)),
|
|
("show_reviews", models.BooleanField(default=True)),
|
|
("show_photos", models.BooleanField(default=True)),
|
|
("show_top_lists", models.BooleanField(default=True)),
|
|
("allow_friend_requests", models.BooleanField(default=True)),
|
|
("allow_messages", models.BooleanField(default=True)),
|
|
("allow_profile_comments", models.BooleanField(default=False)),
|
|
("search_visibility", models.BooleanField(default=True)),
|
|
(
|
|
"activity_visibility",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="privacy_levels",
|
|
choices=[
|
|
("public", "Public"),
|
|
("friends", "Friends Only"),
|
|
("private", "Private"),
|
|
],
|
|
default="friends",
|
|
domain="accounts",
|
|
max_length=10,
|
|
),
|
|
),
|
|
("two_factor_enabled", models.BooleanField(default=False)),
|
|
("login_notifications", models.BooleanField(default=True)),
|
|
("session_timeout", models.IntegerField(default=30)),
|
|
("login_history_retention", models.IntegerField(default=90)),
|
|
("last_password_change", models.DateTimeField(auto_now_add=True)),
|
|
(
|
|
"display_name",
|
|
models.CharField(
|
|
blank=True,
|
|
help_text="Display name shown throughout the site. Falls back to username if not set.",
|
|
max_length=50,
|
|
),
|
|
),
|
|
(
|
|
"notification_preferences",
|
|
models.JSONField(
|
|
blank=True,
|
|
default=dict,
|
|
help_text="Detailed notification preferences stored as JSON",
|
|
),
|
|
),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
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",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="notification_types",
|
|
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"),
|
|
],
|
|
domain="accounts",
|
|
max_length=30,
|
|
),
|
|
),
|
|
("title", models.CharField(max_length=200)),
|
|
("message", models.TextField()),
|
|
("object_id", models.PositiveIntegerField(blank=True, null=True)),
|
|
(
|
|
"priority",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="notification_priorities",
|
|
choices=[
|
|
("low", "Low"),
|
|
("normal", "Normal"),
|
|
("high", "High"),
|
|
("urgent", "Urgent"),
|
|
],
|
|
default="normal",
|
|
domain="accounts",
|
|
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)),
|
|
(
|
|
"content_type",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
to="contenttypes.contenttype",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="notifications",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
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",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="notification_types",
|
|
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"),
|
|
],
|
|
domain="accounts",
|
|
max_length=30,
|
|
),
|
|
),
|
|
("title", models.CharField(max_length=200)),
|
|
("message", models.TextField()),
|
|
("object_id", models.PositiveIntegerField(blank=True, null=True)),
|
|
(
|
|
"priority",
|
|
apps.core.choices.fields.RichChoiceField(
|
|
allow_deprecated=False,
|
|
choice_group="notification_priorities",
|
|
choices=[
|
|
("low", "Low"),
|
|
("normal", "Normal"),
|
|
("high", "High"),
|
|
("urgent", "Urgent"),
|
|
],
|
|
default="normal",
|
|
domain="accounts",
|
|
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)),
|
|
(
|
|
"content_type",
|
|
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",
|
|
),
|
|
),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="accounts.usernotification",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserProfile",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"profile_id",
|
|
models.CharField(
|
|
editable=False,
|
|
help_text="Unique identifier for this profile that remains constant",
|
|
max_length=10,
|
|
unique=True,
|
|
),
|
|
),
|
|
(
|
|
"display_name",
|
|
models.CharField(
|
|
blank=True,
|
|
help_text="Legacy display name field - use User.display_name instead",
|
|
max_length=50,
|
|
),
|
|
),
|
|
("pronouns", models.CharField(blank=True, max_length=50)),
|
|
("bio", models.TextField(blank=True, max_length=500)),
|
|
("twitter", models.URLField(blank=True)),
|
|
("instagram", models.URLField(blank=True)),
|
|
("youtube", models.URLField(blank=True)),
|
|
("discord", models.CharField(blank=True, max_length=100)),
|
|
("coaster_credits", models.IntegerField(default=0)),
|
|
("dark_ride_credits", models.IntegerField(default=0)),
|
|
("flat_ride_credits", models.IntegerField(default=0)),
|
|
("water_ride_credits", models.IntegerField(default=0)),
|
|
(
|
|
"user",
|
|
models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="profile",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserProfileEvent",
|
|
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()),
|
|
(
|
|
"profile_id",
|
|
models.CharField(
|
|
editable=False,
|
|
help_text="Unique identifier for this profile that remains constant",
|
|
max_length=10,
|
|
),
|
|
),
|
|
(
|
|
"display_name",
|
|
models.CharField(
|
|
blank=True,
|
|
help_text="Legacy display name field - use User.display_name instead",
|
|
max_length=50,
|
|
),
|
|
),
|
|
("pronouns", models.CharField(blank=True, max_length=50)),
|
|
("bio", models.TextField(blank=True, max_length=500)),
|
|
("twitter", models.URLField(blank=True)),
|
|
("instagram", models.URLField(blank=True)),
|
|
("youtube", models.URLField(blank=True)),
|
|
("discord", models.CharField(blank=True, max_length=100)),
|
|
("coaster_credits", models.IntegerField(default=0)),
|
|
("dark_ride_credits", models.IntegerField(default=0)),
|
|
("flat_ride_credits", models.IntegerField(default=0)),
|
|
("water_ride_credits", models.IntegerField(default=0)),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="accounts.userprofile",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": 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", "display_name", "email", "email_notifications", "id", "is_active", "is_banned", "is_staff", "is_superuser", "last_login", "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."display_name", NEW."email", NEW."email_notifications", NEW."id", NEW."is_active", NEW."is_banned", NEW."is_staff", NEW."is_superuser", NEW."last_login", 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="1ffd9209b0e1949c05de2548585cda9179288b68",
|
|
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", "display_name", "email", "email_notifications", "id", "is_active", "is_banned", "is_staff", "is_superuser", "last_login", "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."display_name", NEW."email", NEW."email_notifications", NEW."id", NEW."is_active", NEW."is_banned", NEW."is_staff", NEW."is_superuser", NEW."last_login", 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="e5f0a1acc20a9aad226004bc93ca8dbc3511052f",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_0e890",
|
|
table="accounts_user",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
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", "user_id") VALUES (NEW."created_at", NEW."id", NEW."last_sent", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."token", NEW."user_id"); RETURN NULL;',
|
|
hash="c485bf0cd5bea8a05ef2d4ae309b60eff42abd84",
|
|
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", "user_id") VALUES (NEW."created_at", NEW."id", NEW."last_sent", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."token", NEW."user_id"); RETURN NULL;',
|
|
hash="c20942bdc0713db74310da8da8c3138ca4c3bba9",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_7a2a8",
|
|
table="accounts_emailverification",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
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",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="passwordreset",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="insert_insert",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
func='INSERT INTO "accounts_passwordresetevent" ("created_at", "expires_at", "id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "token", "used", "user_id") VALUES (NEW."created_at", NEW."expires_at", NEW."id", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."token", NEW."used", NEW."user_id"); RETURN NULL;',
|
|
hash="496ac059671b25460cdf2ca20d0e43b14d417a26",
|
|
operation="INSERT",
|
|
pgid="pgtrigger_insert_insert_d2b72",
|
|
table="accounts_passwordreset",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="passwordreset",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="update_update",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
|
|
func='INSERT INTO "accounts_passwordresetevent" ("created_at", "expires_at", "id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "token", "used", "user_id") VALUES (NEW."created_at", NEW."expires_at", NEW."id", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."token", NEW."used", NEW."user_id"); RETURN NULL;',
|
|
hash="c40acc416f85287b4a6fcc06724626707df90016",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_526d2",
|
|
table="accounts_passwordreset",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name="toplistitem",
|
|
unique_together={("top_list", "rank")},
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="userdeletionrequest",
|
|
index=models.Index(
|
|
fields=["verification_code"], name="accounts_us_verific_94460d_idx"
|
|
),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="userdeletionrequest",
|
|
index=models.Index(
|
|
fields=["expires_at"], name="accounts_us_expires_1d1dca_idx"
|
|
),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="userdeletionrequest",
|
|
index=models.Index(
|
|
fields=["user", "is_used"], name="accounts_us_user_id_1ce18a_idx"
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="userdeletionrequest",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="insert_insert",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
func='INSERT INTO "accounts_userdeletionrequestevent" ("attempts", "created_at", "email_sent_at", "expires_at", "id", "is_used", "max_attempts", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "user_id", "verification_code") VALUES (NEW."attempts", NEW."created_at", NEW."email_sent_at", NEW."expires_at", NEW."id", NEW."is_used", NEW."max_attempts", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."user_id", NEW."verification_code"); RETURN NULL;',
|
|
hash="c1735fe8eb50247b0afe2bea9d32f83c31da6419",
|
|
operation="INSERT",
|
|
pgid="pgtrigger_insert_insert_b982c",
|
|
table="accounts_userdeletionrequest",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="userdeletionrequest",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="update_update",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
|
|
func='INSERT INTO "accounts_userdeletionrequestevent" ("attempts", "created_at", "email_sent_at", "expires_at", "id", "is_used", "max_attempts", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "user_id", "verification_code") VALUES (NEW."attempts", NEW."created_at", NEW."email_sent_at", NEW."expires_at", NEW."id", NEW."is_used", NEW."max_attempts", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."user_id", NEW."verification_code"); RETURN NULL;',
|
|
hash="6bf807ce3bed069ab30462d3fd7688a7593a7fd0",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_27723",
|
|
table="accounts_userdeletionrequest",
|
|
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",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="userprofile",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="insert_insert",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
func='INSERT INTO "accounts_userprofileevent" ("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."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="b69f494a5e47843d4f7dd5f5963aee8f2e4c120f",
|
|
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" ("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."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="51383e017d62b760128487bff18258e8c892d491",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_87ef6",
|
|
table="accounts_userprofile",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
]
|