2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Up
|
2018-08-14 21:59:41 +00:00
|
|
|
CREATE TABLE maker.price_feeds (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
block_number BIGINT NOT NULL,
|
2018-09-10 21:57:17 +00:00
|
|
|
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
2018-10-22 19:54:09 +00:00
|
|
|
medianizer_address TEXT,
|
2018-08-14 21:59:41 +00:00
|
|
|
usd_value NUMERIC,
|
2018-10-22 19:54:09 +00:00
|
|
|
log_idx INTEGER NOT NULL,
|
2018-09-10 21:57:17 +00:00
|
|
|
tx_idx INTEGER NOT NULL,
|
|
|
|
raw_log JSONB,
|
2018-10-22 19:54:09 +00:00
|
|
|
UNIQUE (header_id, medianizer_address, tx_idx, log_idx)
|
2019-01-22 12:15:29 +00:00
|
|
|
);
|
|
|
|
|
2019-01-22 14:07:11 +00:00
|
|
|
|
2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Down
|
2019-01-22 14:07:11 +00:00
|
|
|
DROP TABLE maker.price_feeds;
|