Skip to main content

MIGRATOR

Static MIGRATOR 

Source
pub static MIGRATOR: Migrator
Expand description

Raw SQLx migrator for inspecting the migrations bundled with this crate version.

Iterating this value to inspect bundled versions and checksums is supported. Calling Migrator::run or Migrator::undo on it with a shared application pool is not. SQLx rejects applied versions absent from the exact bundle, and PostgreSQL migration locks are session-scoped; SQLx can return from a validation error before unlocking and put the still-locked session back into the pool.

Use migrate_after_idempotency_cutover to apply Runledger migrations, or ensure_schema_compatible_after_idempotency_cutover when DDL is managed externally. If a compatibility diagnostic intentionally executes a raw migrator that may mismatch history, give it a disposable connection or single-use pool and close that connection or pool on every error path.

During an additive compatibility window, an exact older binary that cannot use the filtered API must be patched before startup or explicitly accept the data-loss boundary of reverting newer migrations. Reverting the 0.8 migrations erases workflow-recovery lineage/idempotency, active claims, execution-resource keys and claims, retry audit fields, and workflow-step continuation opt-ins. Reverting the post-v0.6 successful-replay migration also erases relational replay lineage and replay-request idempotency state while retaining the underlying replay-created queue rows.