refrakt/migrate

Types

A migration file with its number and name.

pub type Migration {
  Migration(
    number: Int,
    name: String,
    filename: String,
    sql: String,
  )
}

Constructors

  • Migration(
      number: Int,
      name: String,
      filename: String,
      sql: String,
    )

Values

pub fn run_from_directory(
  db_execute: fn(String) -> Result(Nil, String),
  db_query_strings: fn(String) -> Result(List(String), String),
  migrations_dir: String,
) -> Result(Int, String)

Run all pending migrations in a directory. Returns the number of migrations applied.

Search Document