mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 08:31:13 -05:00
Fix: Correct idempotency key migration
Corrected database migration for idempotency keys to resolve issues with partial indexes using `now()`. The migration now includes the `submission_idempotency_keys` table, indexes, RLS policies, a cleanup function, and an `idempotency_stats` view.
This commit is contained in:
@@ -4908,6 +4908,72 @@ export type Database = {
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
submission_idempotency_keys: {
|
||||
Row: {
|
||||
completed_at: string | null
|
||||
created_at: string
|
||||
duration_ms: number | null
|
||||
error_message: string | null
|
||||
expires_at: string
|
||||
id: string
|
||||
idempotency_key: string
|
||||
item_ids: Json
|
||||
moderator_id: string
|
||||
request_id: string | null
|
||||
result_data: Json | null
|
||||
status: string
|
||||
submission_id: string
|
||||
trace_id: string | null
|
||||
}
|
||||
Insert: {
|
||||
completed_at?: string | null
|
||||
created_at?: string
|
||||
duration_ms?: number | null
|
||||
error_message?: string | null
|
||||
expires_at?: string
|
||||
id?: string
|
||||
idempotency_key: string
|
||||
item_ids: Json
|
||||
moderator_id: string
|
||||
request_id?: string | null
|
||||
result_data?: Json | null
|
||||
status?: string
|
||||
submission_id: string
|
||||
trace_id?: string | null
|
||||
}
|
||||
Update: {
|
||||
completed_at?: string | null
|
||||
created_at?: string
|
||||
duration_ms?: number | null
|
||||
error_message?: string | null
|
||||
expires_at?: string
|
||||
id?: string
|
||||
idempotency_key?: string
|
||||
item_ids?: Json
|
||||
moderator_id?: string
|
||||
request_id?: string | null
|
||||
result_data?: Json | null
|
||||
status?: string
|
||||
submission_id?: string
|
||||
trace_id?: string | null
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "submission_idempotency_keys_submission_id_fkey"
|
||||
columns: ["submission_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "content_submissions"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "submission_idempotency_keys_submission_id_fkey"
|
||||
columns: ["submission_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "moderation_queue_with_entities"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
submission_item_temp_refs: {
|
||||
Row: {
|
||||
created_at: string
|
||||
@@ -5603,6 +5669,17 @@ export type Database = {
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
idempotency_stats: {
|
||||
Row: {
|
||||
avg_duration_ms: number | null
|
||||
hour: string | null
|
||||
p95_duration_ms: number | null
|
||||
status: string | null
|
||||
total_requests: number | null
|
||||
unique_moderators: number | null
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
moderation_queue_with_entities: {
|
||||
Row: {
|
||||
approval_mode: string | null
|
||||
@@ -5783,6 +5860,7 @@ export type Database = {
|
||||
}
|
||||
Returns: boolean
|
||||
}
|
||||
cleanup_expired_idempotency_keys: { Args: never; Returns: number }
|
||||
cleanup_expired_sessions: { Args: never; Returns: undefined }
|
||||
cleanup_old_page_views: { Args: never; Returns: undefined }
|
||||
cleanup_old_request_metadata: { Args: never; Returns: undefined }
|
||||
|
||||
Reference in New Issue
Block a user