migrate: last 4 JSON files — live_prices, market, mtf_cache, capital_flow → DB

This commit is contained in:
知微
2026-07-03 13:44:10 +08:00
parent 7cc0ea0ef3
commit bb9b3922c9
27 changed files with 2064 additions and 1256 deletions
+25
View File
@@ -0,0 +1,25 @@
"""Quick verification after JSON→DB migration"""
import sys
sys.path.insert(0, '/home/hmo/MoFin')
from mo_data import read_portfolio, read_decisions, read_watchlist
ok = 0
err = 0
for name, fn in [("portfolio", read_portfolio), ("decisions", read_decisions), ("watchlist", read_watchlist)]:
try:
r = fn()
if name == "portfolio":
n = len(r.get('holdings', []))
elif name == "decisions":
n = len(r.get('decisions', []))
else:
n = len(r.get('stocks', []))
print(f" {name}: {n} records OK")
ok += 1
except Exception as e:
print(f" {name}: ERROR -> {e}")
err += 1
print(f"\n{ok}/3 passed, {err} errors")