Add DB migrations and run them on startup

Enable sqlx "migrate" feature and add SQL migrations to create the
database schema: pg_trgm extension, sources, genres, authors, sequences,
books, junction tables, annotations, and supporting indexes
This commit is contained in:
2026-01-16 10:28:05 +01:00
parent 9ef8a42fd4
commit c60aa8685b
14 changed files with 151 additions and 3 deletions

View File

@@ -42,4 +42,4 @@ rand = "0.9.0"
chrono = { version = "0.4.40", features = ["serde"] }
sqlx = { version = "0.8.3", features = ["runtime-tokio", "postgres", "macros", "chrono", "json"] }
sqlx = { version = "0.8.3", features = ["runtime-tokio", "postgres", "macros", "chrono", "json", "migrate"] }