Skip to main content

migrations

Macro migrations 

Source
macro_rules! migrations {
    ($dir:literal, $($name:literal),* $(,)?) => { ... };
}
Expand description

Embeds migrations in the binary at build time. dir is relative to the crate root, and each name is a folder in it with up.sql and down.sql. The names are listed by hand, and a missing file is a build error. Returns a Result<Migrator, Error>.

ⓘ
let migrator = orbit_orm::migrations!("migrations", "20261108000000_create_users")?;