-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinit_eth_db.sql
More file actions
161 lines (117 loc) · 3.38 KB
/
init_eth_db.sql
File metadata and controls
161 lines (117 loc) · 3.38 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
-- Table: public.config
-- DROP TABLE public.config;
CREATE TABLE public.config
(
trx_height integer
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.config
OWNER to postgres;
-- Table: public.erc20_address_relation
-- DROP TABLE public.erc20_address_relation;
CREATE TABLE public.erc20_address_relation
(
blocknumber integer,
contractaddress character varying(42) COLLATE pg_catalog."default",
"from" character varying(42) COLLATE pg_catalog."default",
"to" character varying(42) COLLATE pg_catalog."default",
txid character varying(68) COLLATE pg_catalog."default",
value character varying(68) COLLATE pg_catalog."default",
"logIndex" integer
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.erc20_address_relation
OWNER to postgres;
COMMENT ON TABLE public.erc20_address_relation
IS 'erc20 about data';
-- Index: contractaddress
-- DROP INDEX public.contractaddress;
CREATE INDEX contractaddress
ON public.erc20_address_relation USING btree
(contractaddress COLLATE pg_catalog."default")
TABLESPACE pg_default;
-- Index: erc20_blocknumber
-- DROP INDEX public.erc20_blocknumber;
CREATE INDEX erc20_blocknumber
ON public.erc20_address_relation USING btree
(blocknumber)
TABLESPACE pg_default;
-- Index: erc20_from
-- DROP INDEX public.erc20_from;
CREATE INDEX erc20_from
ON public.erc20_address_relation USING btree
("from" COLLATE pg_catalog."default")
TABLESPACE pg_default;
-- Index: erc20_to
-- DROP INDEX public.erc20_to;
CREATE INDEX erc20_to
ON public.erc20_address_relation USING btree
("to" COLLATE pg_catalog."default")
TABLESPACE pg_default;
-- Index: erc20_txid
-- DROP INDEX public.erc20_txid;
CREATE INDEX erc20_txid
ON public.erc20_address_relation USING btree
(txid COLLATE pg_catalog."default")
TABLESPACE pg_default;
-- Table: public.relation_address
-- DROP TABLE public.relation_address;
CREATE TABLE public.relation_address
(
"CoinType" character varying(10) COLLATE pg_catalog."default",
"Address" character varying(80) COLLATE pg_catalog."default",
"Erc20Type" boolean
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.relation_address
OWNER to postgres;
-- Table: public.trx_data
-- DROP TABLE public.trx_data;
CREATE TABLE public.trx_data
(
"from" character varying(42) COLLATE pg_catalog."default",
"to" character varying(42) COLLATE pg_catalog."default",
blocknumber integer,
trxid character varying(68) COLLATE pg_catalog."default"
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.trx_data
OWNER to postgres;
COMMENT ON TABLE public.trx_data
IS 'save trx relationship';
-- Index: blockNumber
-- DROP INDEX public."blockNumber";
CREATE INDEX "blockNumber"
ON public.trx_data USING btree
(blocknumber)
TABLESPACE pg_default;
-- Index: from
-- DROP INDEX public."from";
CREATE INDEX "from"
ON public.trx_data USING btree
("from" COLLATE pg_catalog."default" varchar_ops)
TABLESPACE pg_default;
-- Index: to
-- DROP INDEX public."to";
CREATE INDEX "to"
ON public.trx_data USING btree
("to" COLLATE pg_catalog."default" varchar_ops)
TABLESPACE pg_default;
-- Index: trxid
-- DROP INDEX public.trxid;
CREATE INDEX trxid
ON public.trx_data USING btree
(trxid COLLATE pg_catalog."default")
TABLESPACE pg_default;