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
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:
@@ -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))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user