refactor(migration): remove legacy v1 copy file migration logic

Remove the entire migration module (435 lines) that was used for
one-time migration from v3.1.0 to v3.2.0. This cleans up technical
debt and improves startup performance.

Changes:
- Delete src-tauri/src/migration.rs (copy file scanning and merging)
- Remove migration module reference from lib.rs
- Simplify startup logic to only ensure config structure exists
- Remove automatic deduplication and archiving logic

BREAKING CHANGE: Users upgrading from v3.1.0 must first upgrade to
v3.2.x to automatically migrate their configurations.
This commit is contained in:
Jason
2025-11-06 12:22:48 +08:00
parent db80e96786
commit 6f05a91226
2 changed files with 1 additions and 442 deletions

View File

@@ -8,7 +8,6 @@ mod config;
mod error;
mod init_status;
mod mcp;
mod migration;
mod provider;
mod services;
mod settings;
@@ -466,14 +465,9 @@ pub fn run() {
log::warn!("迁移 app_config_dir 失败: {}", e);
}
// 首次启动迁移:扫描副本文件,合并到 config.json并归档副本旧 config.json 先归档
// 确保配置结构就绪(已移除旧版本的副本迁移逻辑)
{
let mut config_guard = app_state.config.write().unwrap();
let migrated = migration::migrate_copies_into_config(&mut config_guard)?;
if migrated {
log::info!("已将副本文件导入到 config.json并完成归档");
}
// 确保两个 App 条目存在
config_guard.ensure_app(&app_config::AppType::Claude);
config_guard.ensure_app(&app_config::AppType::Codex);
}