2019-03-22 03:43:06 +00:00
|
|
|
-- +goose Up
|
2019-08-05 14:04:29 +00:00
|
|
|
CREATE TABLE header_sync_receipts
|
|
|
|
(
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
transaction_id INTEGER NOT NULL REFERENCES header_sync_transactions (id) ON DELETE CASCADE,
|
|
|
|
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
|
|
|
contract_address_id INTEGER NOT NULL REFERENCES addresses (id) ON DELETE CASCADE,
|
|
|
|
cumulative_gas_used NUMERIC,
|
|
|
|
gas_used NUMERIC,
|
|
|
|
state_root VARCHAR(66),
|
|
|
|
status INTEGER,
|
|
|
|
tx_hash VARCHAR(66),
|
|
|
|
rlp BYTEA,
|
|
|
|
UNIQUE (header_id, transaction_id)
|
2019-03-22 03:43:06 +00:00
|
|
|
);
|
|
|
|
|
2019-06-19 19:59:21 +00:00
|
|
|
CREATE INDEX header_sync_receipts_header
|
|
|
|
ON public.header_sync_receipts (header_id);
|
|
|
|
|
|
|
|
CREATE INDEX header_sync_receipts_transaction
|
|
|
|
ON public.header_sync_receipts (transaction_id);
|
2019-03-22 03:43:06 +00:00
|
|
|
|
|
|
|
-- +goose Down
|
2019-06-19 19:59:21 +00:00
|
|
|
DROP INDEX public.header_sync_receipts_header;
|
|
|
|
DROP INDEX public.header_sync_receipts_transaction;
|
|
|
|
|
2019-05-01 06:02:30 +00:00
|
|
|
DROP TABLE header_sync_receipts;
|