mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 23:31:11 -05:00
301 lines
12 KiB
Python
301 lines
12 KiB
Python
# Generated by Django 4.2.8 on 2025-11-09 17:45
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import pgtrigger.compiler
|
|
import pgtrigger.migrations
|
|
import uuid
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
("pghistory", "0006_delete_aggregateevent"),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="ContactSubmission",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.UUIDField(
|
|
default=uuid.uuid4,
|
|
editable=False,
|
|
primary_key=True,
|
|
serialize=False,
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=255)),
|
|
("email", models.EmailField(max_length=254)),
|
|
("subject", models.CharField(max_length=255)),
|
|
("message", models.TextField()),
|
|
(
|
|
"category",
|
|
models.CharField(
|
|
choices=[
|
|
("general", "General Inquiry"),
|
|
("bug", "Bug Report"),
|
|
("feature", "Feature Request"),
|
|
("abuse", "Report Abuse"),
|
|
("data", "Data Correction"),
|
|
("account", "Account Issue"),
|
|
("other", "Other"),
|
|
],
|
|
default="general",
|
|
max_length=50,
|
|
),
|
|
),
|
|
(
|
|
"status",
|
|
models.CharField(
|
|
choices=[
|
|
("pending", "Pending Review"),
|
|
("in_progress", "In Progress"),
|
|
("resolved", "Resolved"),
|
|
("archived", "Archived"),
|
|
],
|
|
db_index=True,
|
|
default="pending",
|
|
max_length=20,
|
|
),
|
|
),
|
|
(
|
|
"ticket_number",
|
|
models.CharField(
|
|
blank=True,
|
|
help_text="Auto-generated ticket number for tracking",
|
|
max_length=20,
|
|
null=True,
|
|
unique=True,
|
|
),
|
|
),
|
|
(
|
|
"admin_notes",
|
|
models.TextField(
|
|
blank=True,
|
|
help_text="Internal notes for admin use only",
|
|
null=True,
|
|
),
|
|
),
|
|
("resolved_at", models.DateTimeField(blank=True, null=True)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"assigned_to",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="assigned_contacts",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
(
|
|
"resolved_by",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="resolved_contacts",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="contact_submissions",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Contact Submission",
|
|
"verbose_name_plural": "Contact Submissions",
|
|
"ordering": ["-created_at"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="ContactSubmissionEvent",
|
|
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.UUIDField(
|
|
default=uuid.uuid4, editable=False, serialize=False
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=255)),
|
|
("email", models.EmailField(max_length=254)),
|
|
("subject", models.CharField(max_length=255)),
|
|
("message", models.TextField()),
|
|
(
|
|
"category",
|
|
models.CharField(
|
|
choices=[
|
|
("general", "General Inquiry"),
|
|
("bug", "Bug Report"),
|
|
("feature", "Feature Request"),
|
|
("abuse", "Report Abuse"),
|
|
("data", "Data Correction"),
|
|
("account", "Account Issue"),
|
|
("other", "Other"),
|
|
],
|
|
default="general",
|
|
max_length=50,
|
|
),
|
|
),
|
|
(
|
|
"status",
|
|
models.CharField(
|
|
choices=[
|
|
("pending", "Pending Review"),
|
|
("in_progress", "In Progress"),
|
|
("resolved", "Resolved"),
|
|
("archived", "Archived"),
|
|
],
|
|
default="pending",
|
|
max_length=20,
|
|
),
|
|
),
|
|
(
|
|
"ticket_number",
|
|
models.CharField(
|
|
blank=True,
|
|
help_text="Auto-generated ticket number for tracking",
|
|
max_length=20,
|
|
null=True,
|
|
),
|
|
),
|
|
(
|
|
"admin_notes",
|
|
models.TextField(
|
|
blank=True,
|
|
help_text="Internal notes for admin use only",
|
|
null=True,
|
|
),
|
|
),
|
|
("resolved_at", models.DateTimeField(blank=True, null=True)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"assigned_to",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
related_query_name="+",
|
|
to="contact.contactsubmission",
|
|
),
|
|
),
|
|
(
|
|
"resolved_by",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="contactsubmission",
|
|
index=models.Index(
|
|
fields=["status", "-created_at"], name="contact_con_status_0384dd_idx"
|
|
),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="contactsubmission",
|
|
index=models.Index(
|
|
fields=["category", "-created_at"],
|
|
name="contact_con_categor_72d10a_idx",
|
|
),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="contactsubmission",
|
|
index=models.Index(
|
|
fields=["ticket_number"], name="contact_con_ticket__fac4eb_idx"
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="contactsubmission",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="insert_insert",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
func='INSERT INTO "contact_contactsubmissionevent" ("admin_notes", "assigned_to_id", "category", "created_at", "email", "id", "message", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "resolved_at", "resolved_by_id", "status", "subject", "ticket_number", "updated_at", "user_id") VALUES (NEW."admin_notes", NEW."assigned_to_id", NEW."category", NEW."created_at", NEW."email", NEW."id", NEW."message", NEW."name", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."resolved_at", NEW."resolved_by_id", NEW."status", NEW."subject", NEW."ticket_number", NEW."updated_at", NEW."user_id"); RETURN NULL;',
|
|
hash="cbbb92ce277f4fa1d4fe3dccd8e111b39c9bc9a6",
|
|
operation="INSERT",
|
|
pgid="pgtrigger_insert_insert_32905",
|
|
table="contact_contactsubmission",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="contactsubmission",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="update_update",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
|
|
func='INSERT INTO "contact_contactsubmissionevent" ("admin_notes", "assigned_to_id", "category", "created_at", "email", "id", "message", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "resolved_at", "resolved_by_id", "status", "subject", "ticket_number", "updated_at", "user_id") VALUES (NEW."admin_notes", NEW."assigned_to_id", NEW."category", NEW."created_at", NEW."email", NEW."id", NEW."message", NEW."name", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."resolved_at", NEW."resolved_by_id", NEW."status", NEW."subject", NEW."ticket_number", NEW."updated_at", NEW."user_id"); RETURN NULL;',
|
|
hash="ff38205a830f0b09c39d88d8bcce780f7c2fd2ab",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_a7348",
|
|
table="contact_contactsubmission",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
]
|