From 8446876eb0ddcdfeaf17bf5d463853f7fece4530 Mon Sep 17 00:00:00 2001 From: OpenSquared Date: Wed, 17 Jun 2026 21:52:50 +0200 Subject: [PATCH] fix: add pnl_pct and capital_invested migration for trade_entry_prices Both columns were referenced in queries (reliability, Kelly, calibration, backtest) but missing from the ALTER TABLE migration block, causing sqlite3.OperationalError: no such column: pnl_pct on existing VPS DBs. Co-Authored-By: Claude Sonnet 4.6 --- backend/services/database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/services/database.py b/backend/services/database.py index 300e583..dea1dd0 100644 --- a/backend/services/database.py +++ b/backend/services/database.py @@ -205,6 +205,8 @@ def init_db(): ("trade_score", "REAL"), ("matched_profile", "TEXT"), ("last_seen_at", "TEXT"), + ("pnl_pct", "REAL"), + ("capital_invested", "REAL"), ]: try: c.execute(f"ALTER TABLE trade_entry_prices ADD COLUMN {col} {definition}")