migrate: last 4 JSON files — live_prices, market, mtf_cache, capital_flow → DB
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user