Run SQLx migrations at startup

Add an initial services table migration and enable the sqlx
"migrate" feature. Introduce run_migrations in db.rs, run
migrations on startup, and pass the PgPool into the router.
This commit is contained in:
2026-01-16 10:35:45 +01:00
parent 4b36cd83a1
commit 36124043b6
5 changed files with 47 additions and 6 deletions

View File

@@ -34,4 +34,4 @@ tracing-subscriber = { version = "0.3.19", features = ["env-filter"]}
sentry-tracing = "0.42.0"
tower-http = { version = "0.6.2", features = ["trace"] }
sqlx = { version = "0.8.3", features = ["runtime-tokio", "postgres", "macros", "chrono"] }
sqlx = { version = "0.8.3", features = ["runtime-tokio", "postgres", "macros", "chrono", "migrate"] }