dynamic_db #17
@@ -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