From 978d9c7a20df6158e0e7828f528090a656ed6292 Mon Sep 17 00:00:00 2001 From: "Bobby (aider)" Date: Tue, 11 Feb 2025 18:34:35 -0800 Subject: [PATCH] feat: Update trading_plans table to use ReplacingMergeTree for better update support --- src/trading/trading_plan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)