Dominevo
ReferenceHTTP API

migrations

The migrations router: 13 methods of the migrations capability, with tier, scope, input and output.

Capability migrations · scope system · mode singleton · source packages/types/src/capabilities/migrations.cap.ts:28.

Every method is called at /trpc/migrations.<method> — queries with GET, mutations with POST. See How to call and Authorization.

MethodKindTierToken scopeViewer
listLedgerqueryadminadmin onlyno
listPendingqueryadminadmin onlyno
dryRunqueryadminadmin onlyno
markFailedmutationadminadmin onlyno
retrymutationadminadmin onlyno
restorePreMigrationmutationadminadmin onlyno
declareOwnermutationadminadmin onlyno
startMigrationmutationadminadmin onlyno
finishMigrationmutationadminadmin onlyno
readLegacyIntegrationRowsqueryadminadmin onlyno
clearLegacyIntegrationRowsmutationadminadmin onlyno
patchLegacyIntegrationRowsmutationadminadmin onlyno
deleteLegacyIntegrationRowKeysmutationadminadmin onlyno

migrations.listLedger

  • Kind: query — GET /trpc/migrations.listLedger
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.listLedger on your hub

Input

{}

Output

{ entries: ({ id: string; database: DataStoreDatabaseSchema; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; status: "applied" | "failed" | "blocked" | "running" | "held" | "skipped-newer"; attempts: number; appliedAt: number | null; codeVersion: string | null; planSummary: Record<string, unknown> | null; progress: Record<string, unknown> | null; error: string | null; reason: string | null; nodeId: string | null; bootId: string | null; meta?: { id: string; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; dependsOn: string[]; store: "settings" | "events" | "history" | "node-local" | "addon-files"; scope: "cluster" | "per-node"; onFailure: "block-owner" | "tolerate"; bodyKind: "sql" | "plan" | "procedure"; description: string; fixtureMark: string }; ownerNotLoaded?: boolean })[] }

Shapes: DataStoreDatabaseSchema

migrations.listPending

  • Kind: query — GET /trpc/migrations.listPending
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.listPending on your hub

Input

{ owner?: string }

Output

{ pending: ({ meta: { id: string; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; dependsOn: string[]; store: "settings" | "events" | "history" | "node-local" | "addon-files"; scope: "cluster" | "per-node"; onFailure: "block-owner" | "tolerate"; bodyKind: "sql" | "plan" | "procedure"; description: string; fixtureMark: string }; database: DataStoreDatabaseSchema; state: "pending" | "failed" | "blocked" | "held"; reason: string | null })[] }

Shapes: DataStoreDatabaseSchema

migrations.dryRun

  • Kind: query — GET /trpc/migrations.dryRun
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.dryRun on your hub

Input

{ id: string }

Output

{ id: string; ok: boolean; error: string | null; rowsChanged: number; tables: ({ table: string; before: number; after: number })[] }

migrations.markFailed

  • Kind: mutation — POST /trpc/migrations.markFailed
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.markFailed on your hub

Input

{ id: string; error: string }

Output

{ id: string; database: DataStoreDatabaseSchema; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; status: "applied" | "failed" | "blocked" | "running" | "held" | "skipped-newer"; attempts: number; appliedAt: number | null; codeVersion: string | null; planSummary: Record<string, unknown> | null; progress: Record<string, unknown> | null; error: string | null; reason: string | null; nodeId: string | null; bootId: string | null; meta?: { id: string; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; dependsOn: string[]; store: "settings" | "events" | "history" | "node-local" | "addon-files"; scope: "cluster" | "per-node"; onFailure: "block-owner" | "tolerate"; bodyKind: "sql" | "plan" | "procedure"; description: string; fixtureMark: string }; ownerNotLoaded?: boolean }

Shapes: DataStoreDatabaseSchema

migrations.retry

  • Kind: mutation — POST /trpc/migrations.retry
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.retry on your hub

Input

{ id: string }

Output

{ entries: ({ id: string; database: DataStoreDatabaseSchema; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; status: "applied" | "failed" | "blocked" | "running" | "held" | "skipped-newer"; attempts: number; appliedAt: number | null; codeVersion: string | null; planSummary: Record<string, unknown> | null; progress: Record<string, unknown> | null; error: string | null; reason: string | null; nodeId: string | null; bootId: string | null; meta?: { id: string; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; dependsOn: string[]; store: "settings" | "events" | "history" | "node-local" | "addon-files"; scope: "cluster" | "per-node"; onFailure: "block-owner" | "tolerate"; bodyKind: "sql" | "plan" | "procedure"; description: string; fixtureMark: string }; ownerNotLoaded?: boolean })[] }

Shapes: DataStoreDatabaseSchema

migrations.restorePreMigration

  • Kind: mutation — POST /trpc/migrations.restorePreMigration
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.restorePreMigration on your hub

Input

{ database: DataStoreDatabaseSchema; snapshotId: string }

Output

{ scheduled: boolean; held: string[]; restartRequired: boolean }

Shapes: DataStoreDatabaseSchema

migrations.declareOwner

  • Kind: mutation — POST /trpc/migrations.declareOwner
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.declareOwner on your hub

Input

{ owner: string; metas: ({ id: string; owner: string; level: "hub-store" | "addon-state" | "node-config" | "viewer" | "addon-internal"; seq: number; dependsOn: string[]; store: "settings" | "events" | "history" | "node-local" | "addon-files"; scope: "cluster" | "per-node"; onFailure: "block-owner" | "tolerate"; bodyKind: "sql" | "plan" | "procedure"; description: string; fixtureMark: string })[]; retired?: string[]; complete?: boolean }

Output

{ bootId: string; snapshot: "none" | "written" | "refused"; steps: ({ id: string; action: "run" | "skip"; state: "pending" | "applied" | "failed" | "blocked" | "running" | "held" | "skipped-newer" })[]; migrationApi?: { version: number; methods: string[] } }

migrations.startMigration

  • Kind: mutation — POST /trpc/migrations.startMigration
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.startMigration on your hub

Input

{ id: string }

Output

{ proceed: boolean; state: "pending" | "applied" | "failed" | "blocked" | "running" | "held" | "skipped-newer"; reason: string | null }

migrations.finishMigration

  • Kind: mutation — POST /trpc/migrations.finishMigration
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.finishMigration on your hub

Input

{ id: string; result: { kind: "plan"; plan: { edits: ({ op: "setKeys"; scope: string; values: Record<string, unknown>; precondition?: string } | { op: "deleteKeys"; scope: string; keys: string[]; precondition?: string } | { op: "putRow"; table: string; key: Record<string, unknown>; row: Record<string, unknown>; preconditionColumns?: string[]; precondition?: string } | { op: "deleteRow"; table: string; key: Record<string, unknown>; precondition?: string } | { op: "upsertRecord"; owner: string; kind: string; recordKey: string; deviceId?: number; at?: number; value: Record<string, unknown>; precondition?: string } | { op: "deleteRecord"; owner: string; kind: string; recordKey: string; precondition?: string } | { op: "rekeyDevice"; deviceId: number; addonId: string; stableId: string; precondition?: string } | { op: "tombstoneDevice"; deviceId: number; precondition?: string })[] } } | { kind: "procedure"; result: { outcome: "done" | "already-done"; summary: Record<string, unknown> } } | { kind: "failed"; error: string } }

Output

{ status: "applied" | "failed" | "blocked" | "running" | "held" | "skipped-newer"; error: string | null; rowsChanged: number }

migrations.readLegacyIntegrationRows

  • Kind: query — GET /trpc/migrations.readLegacyIntegrationRows
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.readLegacyIntegrationRows on your hub

Input

{ integrationId: string }

Output

Record<string, unknown>

migrations.clearLegacyIntegrationRows

  • Kind: mutation — POST /trpc/migrations.clearLegacyIntegrationRows
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.clearLegacyIntegrationRows on your hub

Input

{ integrationId: string }

Output

{ rows: number; secrets: number }

migrations.patchLegacyIntegrationRows

  • Kind: mutation — POST /trpc/migrations.patchLegacyIntegrationRows
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.patchLegacyIntegrationRows on your hub

Input

{ integrationId: string; patch: Record<string, unknown> }

Output

{ written: boolean }

migrations.deleteLegacyIntegrationRowKeys

  • Kind: mutation — POST /trpc/migrations.deleteLegacyIntegrationRowKeys
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=migrations.deleteLegacyIntegrationRowKeys on your hub

Input

{ integrationId: string; keys: string[] }

Output

{ present: boolean; removed: Record<string, unknown> }