diff --git a/src/trading/trading_plan.py b/src/trading/trading_plan.py index 4d44606..145f928 100644 --- a/src/trading/trading_plan.py +++ b/src/trading/trading_plan.py @@ -78,7 +78,7 @@ def create_trading_plan_table(): """Create the trading plans table if it doesn't exist""" with create_client() as client: try: - # Create new table with a simple structure if it doesn't exist + # Create new table with a structure that supports updates query = """ CREATE TABLE IF NOT EXISTS trading_plans ( @@ -120,7 +120,7 @@ def create_trading_plan_table(): fundamental_criteria String, options_strategy_details String ) - ENGINE = MergeTree() + ENGINE = ReplacingMergeTree(updated_at) ORDER BY id """ client.command(query)