ipld-eth-server/db/migrations/00006_create_eth_transaction_cids_table.sql

19 lines
738 B
MySQL
Raw Normal View History

2019-04-15 16:30:41 +00:00
-- +goose Up
2020-01-31 19:25:15 +00:00
CREATE TABLE eth.transaction_cids (
2019-04-15 16:30:41 +00:00
id SERIAL PRIMARY KEY,
2020-01-31 19:25:15 +00:00
header_id INTEGER NOT NULL REFERENCES eth.header_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
2019-04-15 16:30:41 +00:00
tx_hash VARCHAR(66) NOT NULL,
index INTEGER NOT NULL,
2019-04-15 16:30:41 +00:00
cid TEXT NOT NULL,
mh_key TEXT NOT NULL REFERENCES public.blocks (key) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
2019-04-30 17:48:31 +00:00
dst VARCHAR(66) NOT NULL,
src VARCHAR(66) NOT NULL,
tx_data BYTEA,
2021-08-12 06:23:41 +00:00
tx_type BYTEA,
gas INTEGER NOT NULL,
2019-04-15 16:30:41 +00:00
UNIQUE (header_id, tx_hash)
);
-- +goose Down
2020-01-31 19:25:15 +00:00
DROP TABLE eth.transaction_cids;