diff --git a/src/main.rs b/src/main.rs index 3e254b3..a079bca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,13 @@ async fn app() -> Router { .await .expect("Failed to create pool"); + // Run migrations using the sqlx::migrate! macro + // Assumes your migrations are in a ./migrations folder relative to Cargo.toml + sqlx::migrate!("./migrations") + .run(&pool) + .await + .expect("Failed to run migrations on testcontainer DB"); + routes().await.layer(axum::Extension(pool)) }