-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
38 lines (34 loc) · 1.12 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-------------------------------------------------
-- Meta tables to store Substreams information --
-------------------------------------------------
CREATE TABLE IF NOT EXISTS cursors
(
id String,
cursor String,
block_num Int64,
block_id String
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY (id)
ORDER BY (id);
-----------------------------------------------------------
-- Tables to store the raw events without any processing --
-----------------------------------------------------------
CREATE TABLE IF NOT EXISTS contract_creation
(
-- block --
block_hash String,
block_number UInt64,
block_time DateTime,
block_date Date,
-- contract creation --
contract_address String,
creator_factory String,
creator_address String,
creator_tx String,
code String,
-- init String, -- NOT IMPLEMENTED
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY (block_hash, contract_address)
ORDER BY (block_hash, contract_address);