pub fn run_migration_chain<M: Migrator>(
migrations: Vec<M>,
target: u32,
) -> Result<(), MigrationChainError>Expand description
Validate an ordered migration chain end-to-end, then run each step in sequence.
Every invariant is checked before any transform runs, so an invalid chain reverts without writing state:
- the list is non-empty,
- the first migration’s input version equals the stored state version,
- each migration’s output version equals the next migration’s input version, and
- the last migration’s output version equals
target.
Only then are the migrations run in order; each Migrator::run independently re-asserts
stored == input_version() and bumps the stored version to its output.