feat(db): add sqlx migrate feature and renumber migration files

- Add 'migrate' feature to sqlx dependency
- Renumber migrations to fix duplicate version numbers (two 014 files)
- Re-sequence migrations 009-012 for continuous ordering
- Add ALTER TABLE ADD COLUMN IF NOT EXISTS baseline for notification
  table to handle existing databases missing newer columns
- Remove deleted IM migration files (009-012) that were superseded
This commit is contained in:
zhenyi
2026-06-10 18:48:43 +08:00
parent d98e4d59e3
commit d6c468a9fc
11 changed files with 203 additions and 947 deletions
+5 -5
View File
@@ -16,19 +16,18 @@ path = "main.rs"
name = "gen_openapi"
path = "gen_openapi.rs"
[dependencies]
sqlx = { version = "0.9.0", features = ["postgres","runtime-tokio","chrono","uuid","json"] }
sqlx = { version = "0.9.0", features = ["postgres","runtime-tokio","chrono","uuid","json","migrate"] }
tokio = { version = "1.52.3", features = ["full"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.150", features = [] }
chrono = { version = "0.4.19", features = ["serde"] }
uuid = { version = "1.23.1", features = ["serde","v4","v7"] }
uuid = { version = "1.23.1", features = ["serde","v4","v7","v5"] }
reqwest = { version = "0.13.4", features = ["json"] }
tracing = { version = "0.1.44", features = [] }
tracing-subscriber = { version = "0.3.23", features = ["fmt"] }
dotenvy = "0.15.7"
thiserror = "2"
redis = { version = "1.2.1", features = ["cluster","cluster-async","aio","tokio-comp","r2d2"] }
r2d2 = { version = "0.8.10", features = [] }
redis = { version = "1.2.1", features = ["cluster","cluster-async","aio","tokio-comp","connection-manager"] }
dashmap = "6.1"
object_store = { version = "0.13.2", features = ["tokio","aws","cloud"] }
argon2 = "0.5"
@@ -46,13 +45,14 @@ prost = "0.14.3"
prost-types = "0.14.3"
tonic-prost = "0.14.6"
url = "2.5"
etcd-client = "0.14"
etcd-client = { version = "0.18.0", features = ["tls"] }
tokio-stream = "0.1"
async-nats = "0.49"
futures-util = "0.3"
utoipa = { version = "5.5.0", features = ["uuid","chrono","actix_extras","decimal","macros"]}
actix-web = { version = "4", features = ["secure-cookies"] }
actix-multipart = "0.7"
hex = "0.4.3"
[build-dependencies]
tonic-prost-build = "0.14.6"