feat: Update ClickHouse table creation with ReplacingMergeTree and DateTime64
This commit is contained in:
parent
f9c8d43a86
commit
7b6d890d7e
@ -82,8 +82,8 @@ def create_trading_plan_table():
|
|||||||
id UInt32,
|
id UInt32,
|
||||||
plan_name String,
|
plan_name String,
|
||||||
status String,
|
status String,
|
||||||
created_at DateTime,
|
created_at DateTime64(3),
|
||||||
updated_at DateTime,
|
updated_at DateTime64(3),
|
||||||
|
|
||||||
timeframe String,
|
timeframe String,
|
||||||
market_focus String,
|
market_focus String,
|
||||||
@ -123,9 +123,8 @@ def create_trading_plan_table():
|
|||||||
fundamental_criteria Nullable(String),
|
fundamental_criteria Nullable(String),
|
||||||
options_strategy_details Nullable(String)
|
options_strategy_details Nullable(String)
|
||||||
)
|
)
|
||||||
ENGINE = MergeTree()
|
ENGINE = ReplacingMergeTree(updated_at)
|
||||||
PRIMARY KEY (id)
|
ORDER BY (id)
|
||||||
ORDER BY (id, created_at)
|
|
||||||
"""
|
"""
|
||||||
client.execute(query)
|
client.execute(query)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user