Skip to main content

migrate_after_idempotency_cutover

Function migrate_after_idempotency_cutover 

Source
pub async fn migrate_after_idempotency_cutover(
    pool: &DbPool,
) -> Result<(), SchemaCompatibilityError>
Expand description

Apply the bundled Runledger schema migrations to a PostgreSQL pool, then enforce the idempotency snapshot cutover.

This is intentionally named as a hard-cutover API. Downstream applications upgrading from older Runledger versions must update their startup code and verify no keyed legacy rows remain without enqueue_request snapshots. This function applies every pending bundled migration immediately, including the workflow-step/job-link contract migration that removes job_queue.workflow_step_id and crosses the 0.10 rollback boundary. For a mixed-version rollout, apply the expand migration externally, deploy and drain all 0.10 writers and leases, then apply the contract migration; use ensure_schema_compatible_after_idempotency_cutover for startup checks during that staged rollout.

Unlike raw MIGRATOR execution, this filters shared SQLx history through Runledger’s migration compatibility fence so declared additive migrations can coexist with older compatible startup code.