Full-fidelity migration params. Extends CreateEscalationParams with:

  • id (required) — preserves the original UUID; no auto-generation
  • lifecycle state fields (status, assignedTo, claimExpiresAt, …) — carry over the exact state of the migrated row so in-flight escalations land correctly
  • createdAt / updatedAt — preserve original timestamps

The underlying INSERT uses ON CONFLICT (id) DO NOTHING, so calling migrate() multiple times with the same ID is safe — subsequent calls return null without touching the existing row.

interface MigrateEscalationParams {
    appId?: string;
    assignedTo?: string;
    claimedAt?: Date;
    claimExpiresAt?: Date;
    createdAt?: Date;
    createdBy?: string;
    description?: string;
    entity?: string;
    envelope?: Record<string, unknown>;
    escalationPayload?: Record<string, unknown>;
    expiresAt?: Date;
    id: string;
    initiatedBy?: string;
    metadata?: Record<string, unknown>;
    milestones?: {
        name: string;
        value: unknown;
        [key: string]: unknown;
    }[];
    namespace?: string;
    originId?: string;
    parentId?: string;
    priority?: number;
    resolvedAt?: Date;
    resolverPayload?: Record<string, unknown>;
    role?: string;
    signalKey?: string;
    spanId?: string;
    status?:
        | "pending"
        | "claimed"
        | "resolved"
        | "cancelled"
        | "expired";
    subtype?: string;
    taskId?: string;
    taskQueue?: string;
    topic?: string;
    traceId?: string;
    type?: string;
    updatedAt?: Date;
    workflowId?: string;
    workflowType?: string;
}

Hierarchy (view full)

Properties

appId?: string
assignedTo?: string
claimedAt?: Date
claimExpiresAt?: Date
createdAt?: Date
createdBy?: string
description?: string
entity?: string
envelope?: Record<string, unknown>
escalationPayload?: Record<string, unknown>
expiresAt?: Date
id: string

Required — preserve the original UUID from the source table.

initiatedBy?: string
metadata?: Record<string, unknown>
milestones?: {
    name: string;
    value: unknown;
    [key: string]: unknown;
}[]
namespace?: string
originId?: string
parentId?: string
priority?: number
resolvedAt?: Date
resolverPayload?: Record<string, unknown>
role?: string
signalKey?: string
spanId?: string
status?:
    | "pending"
    | "claimed"
    | "resolved"
    | "cancelled"
    | "expired"
subtype?: string
taskId?: string
taskQueue?: string
topic?: string
traceId?: string
type?: string
updatedAt?: Date
workflowId?: string
workflowType?: string