Files
cc-switch/src-tauri
T
Jason 1af20b5f8f feat: add dry-run mode for JSON→SQLite migration
Core changes:
- Extract transaction logic into reusable migrate_from_json_tx() helper
- Add migrate_from_json_dry_run() for in-memory validation without disk writes
- Implement three-state migration mode enum (Disabled/DryRun/Enabled)
- Support CC_SWITCH_ENABLE_JSON_DB_MIGRATION=dryrun for safe testing

Code quality improvements:
- Remove redundant migration_needed variable
- Unify all log messages to English
- Use info level for user-initiated operations instead of warn
- Add explicit drop(tx) in dry-run to clarify intent

Testing:
- Add dry_run_does_not_write_to_disk test
- Add dry_run_validates_schema_compatibility test with real data
- All 6 database tests passing, zero clippy warnings

This enables users to safely validate migration compatibility before
committing to the database, catching schema mismatches early.
1af20b5f8f · 2025-11-24 23:35:39 +08:00
History
..
2025-11-22 19:18:35 +08:00
2025-11-24 11:00:45 +08:00
2025-11-24 11:00:45 +08:00
2025-11-22 19:18:35 +08:00