migrate: remove JSON, DB-only — mo_data, server, scripts, prompts (27 files)

This commit is contained in:
知微
2026-07-03 12:12:05 +08:00
parent b1a79d962c
commit b3bedc8024
43 changed files with 8272 additions and 7449 deletions
+23
View File
@@ -0,0 +1,23 @@
import sqlite3, sys
sys.path.insert(0, '/home/hmo/MoFin')
from strategy_lifecycle import regenerate_all
db = sqlite3.connect('/home/hmo/web-dashboard/data/mofin.db')
# Step 1: Add UNIQUE index if not exists
try:
db.execute("CREATE UNIQUE INDEX IF NOT EXISTS idx_strategy_code ON holding_strategies(code)")
print("UNIQUE index added")
except sqlite3.OperationalError as e:
print(f"Index already exists or error: {e}")
# Step 2: Clear old stale data from holding_strategies (regenerate_all will rewrite)
deleted = db.execute("DELETE FROM holding_strategies").rowcount
print(f"Cleared {deleted} old strategy entries")
db.commit()
db.close()
# Step 3: Full regenerate
print("\n=== Running regenerate_all ===")
regenerate_all(stdout=True)
print("\nDone!")