feat(store): api/reaper/offsite/migrate 按版本集合校验 schema,库比二进制新时拒绝启动;bootstrap 迁移前失败回滚宿主二进制

This commit is contained in:
Lemon-miaow committed 2026-09-25 01:46:33 +08:00
1 parent b1678f78c8
commit 3ed6603201
17 files changed
+390 -38

No files matched your search

+2 -10
View File
@@ -33,17 +33,9 @@ func applyMigrations(dbURL string) (int, error) {
if _, err := store.Up(ctx, drv, migrations); err != nil {
return 0, err
}
applied, err := drv.AppliedVersions(ctx)
s, err := store.ReadSchema(ctx, drv)
if err != nil {
return 0, err
}
return len(applied), nil
}
func totalMigrations() (int, error) {
migrations, err := store.LoadMigrations()
if err != nil {
return 0, err
}
return len(migrations), nil
return s.Applied, nil
}