pub enum MigrationError {
NotContiguous {
position: usize,
found: u32,
expected: u32,
},
SchemaTooNew {
current: u32,
supported: u32,
},
Failed {
version: u32,
name: &'static str,
source: Box<DbError>,
},
Ledger(Box<DbError>),
}Expand description
Why running the synced-schema ladder failed. Carried as its own arm of
OpenError at the Database::open boundary — not
flattened into a DbError string — so the variants stay typed for the
engine’s own tests, the snapshot bootstrap gate, and hosts matching
MigrationError::SchemaTooNew to prompt an app update.
Variants§
NotContiguous
The registered set is not exactly 1..=N ascending with no gaps or
duplicates — a host wiring bug, surfaced at startup before any DDL runs.
SchemaTooNew
The on-disk schema version is newer than this binary’s top migration, so this binary cannot apply a changeset (or open a snapshot image) at that version. Covers opening a snapshot written by a newer device and an older binary reopening a db a newer binary already migrated.
Failed
A migration’s DDL or backfill failed. Its transaction rolled back, so
user_version did not advance over the half-applied step.
Ledger(Box<DbError>)
Reading or writing user_version, or the BEGIN/COMMIT around a step,
failed.