Skip to main content

rollback

Function rollback 

Source
pub async fn rollback(
    pool: &DbPool,
    dir: &str,
    n: usize,
) -> Result<Vec<String>, DbError>
Available on crate features model-mysql or model-postgres or model-sqlite only.
Expand description

Roll back the last n applied migrations, most recently applied first. Called by DbPool::rollback.

Stops early (returning fewer than n versions) once nothing is left to roll back. Stops with Err at the first missing down file or SQL error; any migrations already rolled back in earlier iterations stay rolled back — each step commits its own transaction independently.