Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing transfers_contract table from schema #60

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions create_schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
(
Expand Down
Loading