From 7fee0e6a4c2fcab218befd36c3f92821415cbd0e Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Fri, 16 Aug 2024 11:53:26 -0400 Subject: [PATCH] Fix missing `transfers_contract` table from schema --- create_schema.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/create_schema.sh b/create_schema.sh index ae934d4..569b725 100755 --- a/create_schema.sh +++ b/create_schema.sh @@ -383,6 +383,49 @@ SELECT contract, timestamp AS updated_at_timestamp FROM supply_change_events; +-- Table to store token transfers primarily indexed by the 'contract' field -- +CREATE TABLE IF NOT EXISTS transfers_contract $ON_CLUSTER_DIRECTIVE +( + trx_id String, + action_index UInt32, + + contract String, + symcode String, + + from String, + to String, + quantity String, + memo String, + + precision UInt32, + amount Int64, + value Float64, + + block_num UInt64, + timestamp DateTime +) + ENGINE = $ENGINE_TYPE + PRIMARY KEY (contract, symcode, trx_id, action_index) + ORDER BY (contract, symcode, trx_id, action_index); + +CREATE MATERIALIZED VIEW transfers_contract_mv $ON_CLUSTER_DIRECTIVE + TO transfers_contract +AS +SELECT trx_id, + action_index, + contract, + symcode, + from, + to, + quantity, + memo, + precision, + amount, + value, + block_num, + timestamp +FROM transfer_events; + -- Table to store token transfers primarily indexed by the 'from' field -- CREATE TABLE IF NOT EXISTS transfers_from $ON_CLUSTER_DIRECTIVE (