1 2 3 4 5 6 7 8 9 10 11 12
use anyhow::Context; use sqlx::SqlitePool; /// Apply migrations from `./migrations`. pub async fn migrate(pool: &SqlitePool) -> anyhow::Result<()> { sqlx::migrate!("./migrations") .run(pool) .await .context("failed to run migrations")?; Ok(()) }