forked from cerc-io/ipld-eth-server
going ahead and indexing the entire uncle blocks (one of the issues open on public); finish tests
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE public.uncles (
|
||||
id SERIAL PRIMARY KEY,
|
||||
hash VARCHAR(66) NOT NULL,
|
||||
block_id INTEGER NOT NULL REFERENCES blocks (id) ON DELETE CASCADE,
|
||||
block_hash VARCHAR(66) NOT NULL,
|
||||
reward NUMERIC NOT NULL,
|
||||
miner VARCHAR(42) NOT NULL,
|
||||
raw JSONB,
|
||||
block_timestamp NUMERIC,
|
||||
eth_node_id INTEGER,
|
||||
eth_node_fingerprint VARCHAR(128),
|
||||
CONSTRAINT eth_nodes_fk FOREIGN KEY (eth_node_id)
|
||||
REFERENCES eth_nodes (id)
|
||||
ON DELETE CASCADE,
|
||||
UNIQUE (block_id, hash)
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE public.uncles;
|
||||
@@ -1,15 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE public.uncle_rewards (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_id INTEGER,
|
||||
block_hash VARCHAR(66) NOT NULL,
|
||||
uncle_hash VARCHAR(66) NOT NULL,
|
||||
uncle_reward NUMERIC NOT NULL,
|
||||
miner_address VARCHAR(66) NOT NULL,
|
||||
CONSTRAINT block_id_fk FOREIGN KEY (block_id)
|
||||
REFERENCES blocks (id)
|
||||
ON DELETE CASCADE
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE public.uncle_rewards;
|
||||
Reference in New Issue
Block a user