-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
79 lines (74 loc) · 2.15 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
-------------------------------------------------
-- 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 transfer_events
(
id String,
block_id String,
block_num UInt64,
timestamp UInt32,
transaction_hash String,
transaction_value UInt256,
transaction_index UInt32,
from String,
to String,
p String,
tick String,
op String,
amt Int64
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY (id)
ORDER BY (id);
CREATE TABLE IF NOT EXISTS mint_events
(
id String,
block_id String,
block_num UInt64,
timestamp UInt32,
transaction_hash String,
transaction_value UInt256,
transaction_index UInt32,
from String,
to String,
p String,
tick String,
op String,
amt Int64
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY (id)
ORDER BY (id);
CREATE TABLE IF NOT EXISTS deploy_events
(
id String,
block_id String,
block_num UInt64,
timestamp UInt32,
transaction_hash String,
transaction_value UInt256,
transaction_index UInt32,
from String,
to String,
p String,
tick String,
op String,
max Int64,
lim Int64
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY (id)
ORDER BY (id);