# Generated by Django 5.2.5 on 2025-08-29 19:16

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):

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        (
            "moderation",
            "0003_bulkoperation_bulkoperationevent_moderationaction_and_more",
        ),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="moderationqueue",
            options={"ordering": ["priority", "created_at"]},
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name="moderationqueue",
            name="insert_insert",
        ),
        pgtrigger.migrations.RemoveTrigger(
            model_name="moderationqueue",
            name="update_update",
        ),
        migrations.RemoveIndex(
            model_name="bulkoperation",
            name="moderation__operati_bc84d9_idx",
        ),
        migrations.RemoveIndex(
            model_name="moderationaction",
            name="moderation__action__7d7882_idx",
        ),
        migrations.RemoveIndex(
            model_name="moderationqueue",
            name="moderation__entity__7c66ff_idx",
        ),
        migrations.RemoveIndex(
            model_name="moderationqueue",
            name="moderation__flagged_169834_idx",
        ),
        migrations.RemoveIndex(
            model_name="moderationreport",
            name="moderation__reporte_04923f_idx",
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="can_cancel",
            field=models.BooleanField(default=True, help_text="Whether this operation can be cancelled"),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="description",
            field=models.TextField(help_text="Description of what this operation does"),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="estimated_duration_minutes",
            field=models.PositiveIntegerField(blank=True, help_text="Estimated duration in minutes", null=True),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="failed_items",
            field=models.PositiveIntegerField(default=0, help_text="Number of items that failed"),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="id",
            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="operation_type",
            field=models.CharField(
                choices=[
                    ("UPDATE_PARKS", "Update Parks"),
                    ("UPDATE_RIDES", "Update Rides"),
                    ("IMPORT_DATA", "Import Data"),
                    ("EXPORT_DATA", "Export Data"),
                    ("MODERATE_CONTENT", "Moderate Content"),
                    ("USER_ACTIONS", "User Actions"),
                    ("CLEANUP", "Cleanup"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="parameters",
            field=models.JSONField(default=dict, help_text="Parameters for the operation"),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="priority",
            field=models.CharField(
                choices=[
                    ("LOW", "Low"),
                    ("MEDIUM", "Medium"),
                    ("HIGH", "High"),
                    ("URGENT", "Urgent"),
                ],
                default="MEDIUM",
                max_length=10,
            ),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="processed_items",
            field=models.PositiveIntegerField(default=0, help_text="Number of items processed"),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="results",
            field=models.JSONField(
                blank=True,
                default=dict,
                help_text="Results and output from the operation",
            ),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="schedule_for",
            field=models.DateTimeField(blank=True, help_text="When to run this operation", null=True),
        ),
        migrations.AlterField(
            model_name="bulkoperation",
            name="total_items",
            field=models.PositiveIntegerField(default=0, help_text="Total number of items to process"),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="can_cancel",
            field=models.BooleanField(default=True, help_text="Whether this operation can be cancelled"),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="description",
            field=models.TextField(help_text="Description of what this operation does"),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="estimated_duration_minutes",
            field=models.PositiveIntegerField(blank=True, help_text="Estimated duration in minutes", null=True),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="failed_items",
            field=models.PositiveIntegerField(default=0, help_text="Number of items that failed"),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="id",
            field=models.BigIntegerField(),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="operation_type",
            field=models.CharField(
                choices=[
                    ("UPDATE_PARKS", "Update Parks"),
                    ("UPDATE_RIDES", "Update Rides"),
                    ("IMPORT_DATA", "Import Data"),
                    ("EXPORT_DATA", "Export Data"),
                    ("MODERATE_CONTENT", "Moderate Content"),
                    ("USER_ACTIONS", "User Actions"),
                    ("CLEANUP", "Cleanup"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="parameters",
            field=models.JSONField(default=dict, help_text="Parameters for the operation"),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="priority",
            field=models.CharField(
                choices=[
                    ("LOW", "Low"),
                    ("MEDIUM", "Medium"),
                    ("HIGH", "High"),
                    ("URGENT", "Urgent"),
                ],
                default="MEDIUM",
                max_length=10,
            ),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="processed_items",
            field=models.PositiveIntegerField(default=0, help_text="Number of items processed"),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="results",
            field=models.JSONField(
                blank=True,
                default=dict,
                help_text="Results and output from the operation",
            ),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="schedule_for",
            field=models.DateTimeField(blank=True, help_text="When to run this operation", null=True),
        ),
        migrations.AlterField(
            model_name="bulkoperationevent",
            name="total_items",
            field=models.PositiveIntegerField(default=0, help_text="Total number of items to process"),
        ),
        migrations.AlterField(
            model_name="moderationaction",
            name="action_type",
            field=models.CharField(
                choices=[
                    ("WARNING", "Warning"),
                    ("USER_SUSPENSION", "User Suspension"),
                    ("USER_BAN", "User Ban"),
                    ("CONTENT_REMOVAL", "Content Removal"),
                    ("CONTENT_EDIT", "Content Edit"),
                    ("CONTENT_RESTRICTION", "Content Restriction"),
                    ("ACCOUNT_RESTRICTION", "Account Restriction"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationaction",
            name="details",
            field=models.TextField(help_text="Detailed explanation of the action"),
        ),
        migrations.AlterField(
            model_name="moderationaction",
            name="duration_hours",
            field=models.PositiveIntegerField(
                blank=True,
                help_text="Duration in hours for temporary actions",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="moderationaction",
            name="expires_at",
            field=models.DateTimeField(blank=True, help_text="When this action expires", null=True),
        ),
        migrations.AlterField(
            model_name="moderationaction",
            name="is_active",
            field=models.BooleanField(default=True, help_text="Whether this action is currently active"),
        ),
        migrations.AlterField(
            model_name="moderationaction",
            name="reason",
            field=models.CharField(help_text="Brief reason for the action", max_length=200),
        ),
        migrations.AlterField(
            model_name="moderationactionevent",
            name="action_type",
            field=models.CharField(
                choices=[
                    ("WARNING", "Warning"),
                    ("USER_SUSPENSION", "User Suspension"),
                    ("USER_BAN", "User Ban"),
                    ("CONTENT_REMOVAL", "Content Removal"),
                    ("CONTENT_EDIT", "Content Edit"),
                    ("CONTENT_RESTRICTION", "Content Restriction"),
                    ("ACCOUNT_RESTRICTION", "Account Restriction"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationactionevent",
            name="details",
            field=models.TextField(help_text="Detailed explanation of the action"),
        ),
        migrations.AlterField(
            model_name="moderationactionevent",
            name="duration_hours",
            field=models.PositiveIntegerField(
                blank=True,
                help_text="Duration in hours for temporary actions",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="moderationactionevent",
            name="expires_at",
            field=models.DateTimeField(blank=True, help_text="When this action expires", null=True),
        ),
        migrations.AlterField(
            model_name="moderationactionevent",
            name="is_active",
            field=models.BooleanField(default=True, help_text="Whether this action is currently active"),
        ),
        migrations.AlterField(
            model_name="moderationactionevent",
            name="reason",
            field=models.CharField(help_text="Brief reason for the action", max_length=200),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="description",
            field=models.TextField(help_text="Detailed description of what needs to be done"),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="entity_id",
            field=models.PositiveIntegerField(blank=True, help_text="ID of the related entity", null=True),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="entity_preview",
            field=models.JSONField(blank=True, default=dict, help_text="Preview data for the entity"),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="entity_type",
            field=models.CharField(
                blank=True,
                help_text="Type of entity (park, ride, user, etc.)",
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="estimated_review_time",
            field=models.PositiveIntegerField(default=30, help_text="Estimated time in minutes"),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="flagged_by",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="flagged_queue_items",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="item_type",
            field=models.CharField(
                choices=[
                    ("CONTENT_REVIEW", "Content Review"),
                    ("USER_REVIEW", "User Review"),
                    ("BULK_ACTION", "Bulk Action"),
                    ("POLICY_VIOLATION", "Policy Violation"),
                    ("APPEAL", "Appeal"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="status",
            field=models.CharField(
                choices=[
                    ("PENDING", "Pending"),
                    ("IN_PROGRESS", "In Progress"),
                    ("COMPLETED", "Completed"),
                    ("CANCELLED", "Cancelled"),
                ],
                default="PENDING",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="tags",
            field=models.JSONField(blank=True, default=list, help_text="Tags for categorization"),
        ),
        migrations.AlterField(
            model_name="moderationqueue",
            name="title",
            field=models.CharField(help_text="Brief title for the queue item", max_length=200),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="description",
            field=models.TextField(help_text="Detailed description of what needs to be done"),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="entity_id",
            field=models.PositiveIntegerField(blank=True, help_text="ID of the related entity", null=True),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="entity_preview",
            field=models.JSONField(blank=True, default=dict, help_text="Preview data for the entity"),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="entity_type",
            field=models.CharField(
                blank=True,
                help_text="Type of entity (park, ride, user, etc.)",
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="estimated_review_time",
            field=models.PositiveIntegerField(default=30, help_text="Estimated time in minutes"),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="flagged_by",
            field=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,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="item_type",
            field=models.CharField(
                choices=[
                    ("CONTENT_REVIEW", "Content Review"),
                    ("USER_REVIEW", "User Review"),
                    ("BULK_ACTION", "Bulk Action"),
                    ("POLICY_VIOLATION", "Policy Violation"),
                    ("APPEAL", "Appeal"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="status",
            field=models.CharField(
                choices=[
                    ("PENDING", "Pending"),
                    ("IN_PROGRESS", "In Progress"),
                    ("COMPLETED", "Completed"),
                    ("CANCELLED", "Cancelled"),
                ],
                default="PENDING",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="tags",
            field=models.JSONField(blank=True, default=list, help_text="Tags for categorization"),
        ),
        migrations.AlterField(
            model_name="moderationqueueevent",
            name="title",
            field=models.CharField(help_text="Brief title for the queue item", max_length=200),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="description",
            field=models.TextField(help_text="Detailed description of the issue"),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="evidence_urls",
            field=models.JSONField(
                blank=True,
                default=list,
                help_text="URLs to evidence (screenshots, etc.)",
            ),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="reason",
            field=models.CharField(help_text="Brief reason for the report", max_length=200),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="report_type",
            field=models.CharField(
                choices=[
                    ("SPAM", "Spam"),
                    ("HARASSMENT", "Harassment"),
                    ("INAPPROPRIATE_CONTENT", "Inappropriate Content"),
                    ("MISINFORMATION", "Misinformation"),
                    ("COPYRIGHT", "Copyright Violation"),
                    ("PRIVACY", "Privacy Violation"),
                    ("HATE_SPEECH", "Hate Speech"),
                    ("VIOLENCE", "Violence or Threats"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="reported_entity_id",
            field=models.PositiveIntegerField(help_text="ID of the entity being reported"),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="reported_entity_type",
            field=models.CharField(
                help_text="Type of entity being reported (park, ride, user, etc.)",
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="resolution_action",
            field=models.CharField(
                blank=True,
                default=django.utils.timezone.now,
                help_text="Action taken to resolve",
                max_length=100,
            ),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="resolution_notes",
            field=models.TextField(blank=True, help_text="Notes about the resolution"),
        ),
        migrations.AlterField(
            model_name="moderationreport",
            name="status",
            field=models.CharField(
                choices=[
                    ("PENDING", "Pending Review"),
                    ("UNDER_REVIEW", "Under Review"),
                    ("RESOLVED", "Resolved"),
                    ("DISMISSED", "Dismissed"),
                ],
                default="PENDING",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="description",
            field=models.TextField(help_text="Detailed description of the issue"),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="evidence_urls",
            field=models.JSONField(
                blank=True,
                default=list,
                help_text="URLs to evidence (screenshots, etc.)",
            ),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="reason",
            field=models.CharField(help_text="Brief reason for the report", max_length=200),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="report_type",
            field=models.CharField(
                choices=[
                    ("SPAM", "Spam"),
                    ("HARASSMENT", "Harassment"),
                    ("INAPPROPRIATE_CONTENT", "Inappropriate Content"),
                    ("MISINFORMATION", "Misinformation"),
                    ("COPYRIGHT", "Copyright Violation"),
                    ("PRIVACY", "Privacy Violation"),
                    ("HATE_SPEECH", "Hate Speech"),
                    ("VIOLENCE", "Violence or Threats"),
                    ("OTHER", "Other"),
                ],
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="reported_entity_id",
            field=models.PositiveIntegerField(help_text="ID of the entity being reported"),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="reported_entity_type",
            field=models.CharField(
                help_text="Type of entity being reported (park, ride, user, etc.)",
                max_length=50,
            ),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="resolution_action",
            field=models.CharField(
                blank=True,
                default=django.utils.timezone.now,
                help_text="Action taken to resolve",
                max_length=100,
            ),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="resolution_notes",
            field=models.TextField(blank=True, help_text="Notes about the resolution"),
        ),
        migrations.AlterField(
            model_name="moderationreportevent",
            name="status",
            field=models.CharField(
                choices=[
                    ("PENDING", "Pending Review"),
                    ("UNDER_REVIEW", "Under Review"),
                    ("RESOLVED", "Resolved"),
                    ("DISMISSED", "Dismissed"),
                ],
                default="PENDING",
                max_length=20,
            ),
        ),
        migrations.AddIndex(
            model_name="bulkoperation",
            index=models.Index(fields=["schedule_for"], name="moderation__schedul_350704_idx"),
        ),
        migrations.AddIndex(
            model_name="bulkoperation",
            index=models.Index(fields=["created_at"], name="moderation__created_b705f4_idx"),
        ),
        migrations.AddIndex(
            model_name="moderationaction",
            index=models.Index(fields=["moderator"], name="moderation__moderat_1c19b0_idx"),
        ),
        migrations.AddIndex(
            model_name="moderationaction",
            index=models.Index(fields=["created_at"], name="moderation__created_6378e6_idx"),
        ),
        migrations.AddIndex(
            model_name="moderationqueue",
            index=models.Index(fields=["created_at"], name="moderation__created_fe6dd0_idx"),
        ),
        migrations.AddIndex(
            model_name="moderationreport",
            index=models.Index(fields=["reported_by"], name="moderation__reporte_81af56_idx"),
        ),
        migrations.AddIndex(
            model_name="moderationreport",
            index=models.Index(fields=["created_at"], name="moderation__created_ae337c_idx"),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="moderationqueue",
            trigger=pgtrigger.compiler.Trigger(
                name="insert_insert",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    func='INSERT INTO "moderation_moderationqueueevent" ("assigned_at", "assigned_to_id", "content_type_id", "created_at", "description", "entity_id", "entity_preview", "entity_type", "estimated_review_time", "flagged_by_id", "id", "item_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "priority", "related_report_id", "status", "tags", "title", "updated_at") VALUES (NEW."assigned_at", NEW."assigned_to_id", NEW."content_type_id", NEW."created_at", NEW."description", NEW."entity_id", NEW."entity_preview", NEW."entity_type", NEW."estimated_review_time", NEW."flagged_by_id", NEW."id", NEW."item_type", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."priority", NEW."related_report_id", NEW."status", NEW."tags", NEW."title", NEW."updated_at"); RETURN NULL;',
                    hash="55993d8cb4981feed7b3febde9e87989481a8a34",
                    operation="INSERT",
                    pgid="pgtrigger_insert_insert_cf9cb",
                    table="moderation_moderationqueue",
                    when="AFTER",
                ),
            ),
        ),
        pgtrigger.migrations.AddTrigger(
            model_name="moderationqueue",
            trigger=pgtrigger.compiler.Trigger(
                name="update_update",
                sql=pgtrigger.compiler.UpsertTriggerSql(
                    condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
                    func='INSERT INTO "moderation_moderationqueueevent" ("assigned_at", "assigned_to_id", "content_type_id", "created_at", "description", "entity_id", "entity_preview", "entity_type", "estimated_review_time", "flagged_by_id", "id", "item_type", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "priority", "related_report_id", "status", "tags", "title", "updated_at") VALUES (NEW."assigned_at", NEW."assigned_to_id", NEW."content_type_id", NEW."created_at", NEW."description", NEW."entity_id", NEW."entity_preview", NEW."entity_type", NEW."estimated_review_time", NEW."flagged_by_id", NEW."id", NEW."item_type", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."priority", NEW."related_report_id", NEW."status", NEW."tags", NEW."title", NEW."updated_at"); RETURN NULL;',
                    hash="8da070419fd1efd43bfb272a431392b6244a7739",
                    operation="UPDATE",
                    pgid="pgtrigger_update_update_3b3aa",
                    table="moderation_moderationqueue",
                    when="AFTER",
                ),
            ),
        ),
    ]
