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:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user