Skip to main content

Module version

Module version 

Source
Expand description

Boot-time schema-version check.

RFC-v0.7 Wave 0, Q12. Mirrors the Valkey boot-time partition-count check (Q5). Reads the _sqlx_migrations ledger sqlx writes as part of sqlx::migrate! application and compares the latest applied version to required:

  • ledger < required → refuse to start ([EngineError::Unavailable { op: "schema_version" }]).
  • ledger == required → pass.
  • ledger > required → pass + log-warn iff every intervening migration is annotated backward_compatible=true. Wave 3 adds the annotation column to _sqlx_migrations (or a sibling table); Wave 0 skips the annotation read and unconditionally log-warns on a ledger-ahead match so the boot-diagnostic channel is exercised. The destructive-migration refuse-to-start branch also lands in Wave 3.

Functions§

check_schema_version
Compare the Postgres migration ledger against the binary’s required schema version and enforce Q12’s boot-time contract.