Skip to main content

run_migrations

Function run_migrations 

Source
pub fn run_migrations(
    connection: &ResolvedConnection,
    migrations_dir: &Path,
    migrations_table: &str,
    migrations_schema: &str,
    repair: bool,
) -> Result<MigrationResult, CliError>
Expand description

Applies the pending migrations in migrations_dir and records them in the tracking table, creating or upgrading that table as needed.

With repair, an interrupted migration is first reconciled against the live schema (see drizzle_migrations::repair); without it, an interrupted migration stops the run.

ยงErrors

Returns CliError if no compiled driver matches, connecting fails, the migrations cannot be loaded, a migration is interrupted (and repair is off or cannot reconcile it), a statement fails, or the tracking table cannot be written.