hmo 0650673038 feat: migrate_all.py — 完整数据迁移脚本 (JSON → SQLite)
一次性迁移全部生产数据到 mofin.db:
- stock_profiles.json → stocks (55只)
- portfolio.json → holdings (21只) + holding_strategies (21条)
- watchlist.json → watchlist_stocks (1只) + holding_strategies (1条)
- decisions.json → holding_strategies (316条, 含changelog历史)
- candidate_pool.json → candidates (10只) + candidate_score_history (21条)
- price_events.json → price_events (193条)
- evaluation.json → strategy_evaluations (36条)
- stock_sector_map.json → stock_sectors (62条)

特性:
- 自动从所有JSON源收集股票代码 (collect_all_stocks)
- 代码格式归一化 (_normalize_code: 整数→补零字符串)
- 迁移期间关闭外键约束 (兼容旧数据格式不一致)
- 幂等可重跑 (INSERT OR REPLACE/IGNORE)
- JSON文件不修改,可安全重复执行

替换旧的 migrate_sectors.py (功能已合并)
2026-06-20 16:40:39 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:43:24 +08:00
2026-06-20 12:44:09 +08:00
2026-06-20 12:43:24 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:43:24 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:43:24 +08:00
2026-06-20 12:43:24 +08:00
2026-06-20 12:43:24 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:43:24 +08:00
2026-06-20 12:04:21 +08:00
2026-06-20 12:04:21 +08:00
S
Description
No description provided
133 MiB
Languages
Python 94.2%
HTML 5.8%