ipld-eth-server/db/migrations/00043_create_btc_tx_inputs_table.sql
2020-02-20 16:14:17 -06:00

15 lines
462 B
SQL

-- +goose Up
CREATE TABLE btc.tx_inputs (
id SERIAL PRIMARY KEY,
tx_id INTEGER NOT NULL REFERENCES btc.transaction_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
index INTEGER NOT NULL,
tx_witness BYTEA[],
sequence INTEGER NOT NULL,
script BYTEA NOT NULL,
outpoint_hash VARCHAR(66) NOT NULL,
outpoint_index INTEGER NOT NULL,
UNIQUE (tx_id, index)
);
-- +goose Down
DROP TABLE btc.tx_inputs;