Fix the Sin of Man
- Migrate to ClickHouse - Simplify serde renaming - Simplify backfill logic - Compartmentalize database columns Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
38
support/clickhouse/docker-entrypoint-initdb.d/0000_init.sql
Normal file
38
support/clickhouse/docker-entrypoint-initdb.d/0000_init.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
CREATE TABLE IF NOT EXISTS qrust.assets (
|
||||
symbol String,
|
||||
class Enum('us_equity' = 1, 'crypto' = 2),
|
||||
exchange Enum(
|
||||
'AMEX' = 1,
|
||||
'ARCA' = 2,
|
||||
'BATS' = 3,
|
||||
'NASDAQ' = 4,
|
||||
'NYSE' = 5,
|
||||
'NYSEARCA' = 6,
|
||||
'OTC' = 7,
|
||||
'CRYPTO' = 8
|
||||
),
|
||||
time_added DateTime DEFAULT now()
|
||||
)
|
||||
ENGINE = ReplacingMergeTree()
|
||||
PRIMARY KEY symbol;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS qrust.bars (
|
||||
symbol String,
|
||||
time DateTime,
|
||||
open Float64,
|
||||
high Float64,
|
||||
low Float64,
|
||||
close Float64,
|
||||
volume Int64,
|
||||
trades Int64,
|
||||
vwap Float64
|
||||
)
|
||||
ENGINE = ReplacingMergeTree()
|
||||
PRIMARY KEY (symbol, time);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS qrust.bars_validity (
|
||||
symbol String,
|
||||
time_last DateTime
|
||||
)
|
||||
ENGINE = ReplacingMergeTree()
|
||||
PRIMARY KEY symbol;
|
Reference in New Issue
Block a user