2020-01-31 20:08:51 +00:00
|
|
|
-- +goose Up
|
|
|
|
CREATE TABLE btc.tx_inputs (
|
2020-02-09 21:28:30 +00:00
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
tx_id INTEGER NOT NULL REFERENCES btc.transaction_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
|
|
|
index INTEGER NOT NULL,
|
|
|
|
witness BYTEA[],
|
|
|
|
sig_script BYTEA NOT NULL,
|
|
|
|
outpoint_tx_hash VARCHAR(66) REFERENCES btc.transaction_cids (tx_hash) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
|
|
|
outpoint_index BIGINT NOT NULL,
|
2020-01-31 20:08:51 +00:00
|
|
|
UNIQUE (tx_id, index)
|
|
|
|
);
|
|
|
|
|
|
|
|
-- +goose Down
|
|
|
|
DROP TABLE btc.tx_inputs;
|