forked from forbole/callisto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04-consensus.sql
More file actions
44 lines (40 loc) · 1.39 KB
/
04-consensus.sql
File metadata and controls
44 lines (40 loc) · 1.39 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
CREATE TABLE genesis
(
one_row_id BOOL NOT NULL DEFAULT TRUE PRIMARY KEY,
chain_id TEXT NOT NULL,
time TIMESTAMP NOT NULL,
initial_height BIGINT NOT NULL,
CHECK (one_row_id)
);
CREATE TABLE average_block_time_per_minute
(
one_row_id BOOL NOT NULL DEFAULT TRUE PRIMARY KEY,
average_time DECIMAL NOT NULL,
height BIGINT NOT NULL,
CHECK (one_row_id)
);
CREATE INDEX average_block_time_per_minute_height_index ON average_block_time_per_minute (height);
CREATE TABLE average_block_time_per_hour
(
one_row_id BOOL NOT NULL DEFAULT TRUE PRIMARY KEY,
average_time DECIMAL NOT NULL,
height BIGINT NOT NULL,
CHECK (one_row_id)
);
CREATE INDEX average_block_time_per_hour_height_index ON average_block_time_per_hour (height);
CREATE TABLE average_block_time_per_day
(
one_row_id BOOL NOT NULL DEFAULT TRUE PRIMARY KEY,
average_time DECIMAL NOT NULL,
height BIGINT NOT NULL,
CHECK (one_row_id)
);
CREATE INDEX average_block_time_per_day_height_index ON average_block_time_per_day (height);
CREATE TABLE average_block_time_from_genesis
(
one_row_id BOOL NOT NULL DEFAULT TRUE PRIMARY KEY,
average_time DECIMAL NOT NULL,
height BIGINT NOT NULL,
CHECK (one_row_id)
);
CREATE INDEX average_block_time_from_genesis_height_index ON average_block_time_from_genesis (height);