-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdb-schema.sql
51 lines (42 loc) · 1.14 KB
/
db-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
CREATE EXTENSION citext;
CREATE TABLE public.ethtxs
(
"time" integer,
txfrom citext COLLATE pg_catalog."default",
txto citext COLLATE pg_catalog."default",
gas bigint,
gasprice bigint,
block integer,
txhash citext COLLATE pg_catalog."default" PRIMARY KEY,
value numeric,
contract_to citext COLLATE pg_catalog."default",
contract_value citext COLLATE pg_catalog."default",
status boolean,
data citext COLLATE pg_catalog."default"
);
CREATE TABLE public.aval
(
"status" INTEGER
)
TABLESPACE pg_default;
CREATE INDEX block_index
ON public.ethtxs USING btree
(block)
TABLESPACE pg_default;
CREATE INDEX contract_to_index
ON public.ethtxs USING btree
(contract_to COLLATE pg_catalog."default")
TABLESPACE pg_default;
CREATE INDEX txfrom_index
ON public.ethtxs USING btree
(txfrom COLLATE pg_catalog."default")
TABLESPACE pg_default;
CREATE INDEX txto_index
ON public.ethtxs USING btree
(txto COLLATE pg_catalog."default")
TABLESPACE pg_default;
CREATE VIEW max_block as
SELECT
MAX(block)
FROM public.ethtxs;
INSERT INTO public.aval(status) VALUES (1);