MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / migrateToUnifiedDirsIfNeeded

Method migrateToUnifiedDirsIfNeeded

apps/desktop/main/index.ts:210–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208
209 // 从 Electron 旧目录结构迁移到新的双根目录结构
210 migrateToUnifiedDirsIfNeeded() {
211 if (needsUnifiedDirMigration()) {
212 console.log('[Main] Unified directory migration needed, starting...')
213 const result = migrateToUnifiedDirs()
214 if (result.success) {
215 console.log('[Main] Unified directory migration completed')
216 } else {
217 console.error('[Main] Unified directory migration failed:', result.error)
218 }
219 } else {
220 console.log('[Main] No unified directory migration needed')
221 }
222 }
223
224 // 执行启动期数据库 schema 迁移;失败时必须中断,避免 schema 已升级但兼容门禁未落盘。
225 migrateDatabasesIfNeeded(runtime: RuntimeIdentity) {

Callers 1

initMethod · 0.95

Calls 3

needsUnifiedDirMigrationFunction · 0.90
migrateToUnifiedDirsFunction · 0.90
errorMethod · 0.65

Tested by

no test coverage detected