feat: Update trading_plans table to use ReplacingMergeTree for better update support
This commit is contained in:
parent
aa282de020
commit
978d9c7a20
@ -78,7 +78,7 @@ def create_trading_plan_table():
|
|||||||
"""Create the trading plans table if it doesn't exist"""
|
"""Create the trading plans table if it doesn't exist"""
|
||||||
with create_client() as client:
|
with create_client() as client:
|
||||||
try:
|
try:
|
||||||
# Create new table with a simple structure if it doesn't exist
|
# Create new table with a structure that supports updates
|
||||||
query = """
|
query = """
|
||||||
CREATE TABLE IF NOT EXISTS trading_plans
|
CREATE TABLE IF NOT EXISTS trading_plans
|
||||||
(
|
(
|
||||||
@ -120,7 +120,7 @@ def create_trading_plan_table():
|
|||||||
fundamental_criteria String,
|
fundamental_criteria String,
|
||||||
options_strategy_details String
|
options_strategy_details String
|
||||||
)
|
)
|
||||||
ENGINE = MergeTree()
|
ENGINE = ReplacingMergeTree(updated_at)
|
||||||
ORDER BY id
|
ORDER BY id
|
||||||
"""
|
"""
|
||||||
client.command(query)
|
client.command(query)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user