Integrated migrations
All checks were successful
Rust Build / Check (pull_request) Successful in 47s
Rust Build / Test Suite (pull_request) Successful in 1m1s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 46s
Rust Build / build (pull_request) Successful in 1m16s

This commit is contained in:
2025-04-03 15:21:13 -04:00
parent 943d258cc0
commit 9cfec4fa27

View File

@@ -37,6 +37,13 @@ async fn app() -> Router {
.await .await
.expect("Failed to create pool"); .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)) routes().await.layer(axum::Extension(pool))
} }