gorrion/runner

Executes migration SQL within transactions.

Values

pub fn apply_migration(
  db: pog.Connection,
  migration: types.Migration,
) -> Result(Nil, types.MigrationError)

Apply a single migration: execute the up SQL, then record it. Each migration runs inside a database transaction.

pub fn revert_migration(
  db: pog.Connection,
  migration: types.Migration,
) -> Result(Nil, types.MigrationError)

Revert a single migration: execute the down SQL, then remove the record. If no down SQL was provided (empty string), just removes the tracking record.

Search Document