up

Function up 

Source
pub fn up(conn: &mut Connection, migrations: &[Migration]) -> MigrateResult<()>
Expand description

Executes all pending migrations in order.

This function:

  1. Ensures the migrations tracking table exists
  2. Identifies which migrations have already been applied
  3. Executes pending migrations in the order they appear in the slice
  4. Records each migration as applied

All migrations are executed within a single transaction for atomicity.

§Arguments

  • conn - Mutable reference to the SQLite connection
  • migrations - Slice of migrations to apply in order

§Errors

Returns an error if:

  • Database operations fail
  • Migration SQL is invalid
  • Transaction cannot be committed