2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Up
|
2019-08-27 21:30:50 +00:00
|
|
|
CREATE TABLE public.headers
|
|
|
|
(
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
hash VARCHAR(66),
|
|
|
|
block_number BIGINT,
|
|
|
|
raw JSONB,
|
|
|
|
block_timestamp NUMERIC,
|
|
|
|
check_count INTEGER NOT NULL DEFAULT 0,
|
|
|
|
eth_node_id INTEGER NOT NULL REFERENCES eth_nodes (id) ON DELETE CASCADE,
|
2019-09-26 18:58:48 +00:00
|
|
|
eth_node_fingerprint VARCHAR(128),
|
|
|
|
UNIQUE (block_number, hash, eth_node_fingerprint)
|
2019-01-22 12:15:29 +00:00
|
|
|
);
|
|
|
|
|
2019-03-05 10:52:38 +00:00
|
|
|
-- Index is removed when table is
|
|
|
|
CREATE INDEX headers_block_number ON public.headers (block_number);
|
|
|
|
|
2019-01-22 14:07:11 +00:00
|
|
|
|
2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Down
|
2019-01-22 14:07:11 +00:00
|
|
|
DROP TABLE public.headers;
|