UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

30 lines (29 loc) • 1.04 kB
import { a as resolveSqliteDatabaseFilePaths } from "./sqlite-files-rWisKj_V.mjs"; import { i as withDoctorSqliteMaintenanceLock } from "./doctor-sqlite-maintenance-lock-BDftygVG.mjs"; import { o as restoreScopedMigrationSnapshot } from "./sqlite-migration-scoped-snapshot-p3QIp2zu.mjs"; import path from "node:path"; //#region src/commands/doctor-migration-backup-restore.ts /** Scoped archives are applied in place, never substituted for a complete database. */ async function restoreDoctorMigrationBackup(e) { const t = path.resolve(e.sourcePath); const n = path.resolve(e.backupPath); return withDoctorSqliteMaintenanceLock({ env: e.env, operation: "scoped migration backup restore", protectedPaths: [...resolveSqliteDatabaseFilePaths(t), n], run: (e) => { restoreScopedMigrationSnapshot({ sourcePath: t, backupPath: n, assertCurrent: () => e.assertCurrent() }); return { restored: true, sourcePath: t, backupPath: n }; } }); } //#endregion export { restoreDoctorMigrationBackup };