feat(server): cmd/migrate up 接入 codes 库自建迁移(ApplyCodesLibMigrations)(#codes-lib)

顺带修 000020 sqlite 索引名冲突:ALTER TABLE RENAME 不会带着重命名索引,
legacy_codes 上遗留的 idx_codes_status 与 codes 库自己迁移里同名索引撞名,
一并改成 idx_legacy_codes_status(up/down 对称)。
This commit is contained in:
wangjia
2026-07-10 13:55:14 +08:00
parent 665749a90b
commit 5a9b5f1d8e
6 changed files with 67 additions and 0 deletions
+4
View File
@@ -12,6 +12,7 @@
package main
import (
"context"
"fmt"
"log"
"os"
@@ -44,6 +45,9 @@ func main() {
if err := store.MigrateUp(db, driver); err != nil {
log.Fatalf("migrate up: %v", err)
}
if err := store.ApplyCodesLibMigrations(context.Background(), db, driver); err != nil {
log.Fatalf("migrate up (codes lib): %v", err)
}
log.Println("migrate: up — done")
case "down":