2019-04-15 16:30:41 +00:00
|
|
|
-- +goose Up
|
2020-01-31 19:25:15 +00:00
|
|
|
CREATE TABLE eth.header_cids (
|
2019-04-15 16:30:41 +00:00
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
block_number BIGINT NOT NULL,
|
|
|
|
block_hash VARCHAR(66) NOT NULL,
|
2020-01-17 23:16:01 +00:00
|
|
|
parent_hash VARCHAR(66) NOT NULL,
|
2019-04-15 16:30:41 +00:00
|
|
|
cid TEXT NOT NULL,
|
2020-07-13 15:39:51 +00:00
|
|
|
mh_key TEXT NOT NULL REFERENCES public.blocks (key) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
2020-02-10 17:11:44 +00:00
|
|
|
td NUMERIC NOT NULL,
|
2020-02-10 15:00:55 +00:00
|
|
|
node_id INTEGER NOT NULL REFERENCES nodes (id) ON DELETE CASCADE,
|
2020-02-20 22:13:19 +00:00
|
|
|
reward NUMERIC NOT NULL,
|
2020-07-13 15:39:51 +00:00
|
|
|
state_root VARCHAR(66) NOT NULL,
|
|
|
|
tx_root VARCHAR(66) NOT NULL,
|
|
|
|
receipt_root VARCHAR(66) NOT NULL,
|
|
|
|
uncle_root VARCHAR(66) NOT NULL,
|
|
|
|
bloom BYTEA NOT NULL,
|
|
|
|
timestamp NUMERIC NOT NULL,
|
|
|
|
times_validated INTEGER NOT NULL DEFAULT 1,
|
2021-08-12 06:23:41 +00:00
|
|
|
base_fee BIGINT,
|
2019-04-15 16:30:41 +00:00
|
|
|
UNIQUE (block_number, block_hash)
|
|
|
|
);
|
|
|
|
|
|
|
|
-- +goose Down
|
2020-01-31 19:25:15 +00:00
|
|
|
DROP TABLE eth.header_cids;
|