fix(cmd): 维护子命令改经 OpenData 打开,--allow-newer 仅限 start/init

passwd/backup/gc 不再触发迁移与 user_version 守卫,回滚旧二进制场景备份仍可用(round2 P1-5,落实 D6)。
This commit is contained in:
2026-09-08 17:32:52 +08:00
parent 132c4a1ba2
commit a35e7fdfd3
2 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -238,7 +238,7 @@ func runResetPassword(args []string) error {
if err != nil {
return err
}
st, err := store.Open(cfg.DBPath(), false)
st, err := store.OpenData(cfg.DBPath())
if err != nil {
return err
}
@@ -313,7 +313,7 @@ func runBackup(args []string) error {
if dest == "" {
dest = filepath.Join(cfg.DataDir, fmt.Sprintf("pn-backup-%s.db", time.Now().Format("20060102-150405")))
}
st, err := store.Open(cfg.DBPath(), false)
st, err := store.OpenData(cfg.DBPath())
if err != nil {
return err
}
@@ -337,7 +337,7 @@ func runGC(args []string) error {
commit = true
}
}
st, err := store.Open(cfg.DBPath(), false)
st, err := store.OpenData(cfg.DBPath())
if err != nil {
return err
}