2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Up
|
2018-05-07 15:41:02 +00:00
|
|
|
BEGIN;
|
|
|
|
|
|
|
|
ALTER TABLE blocks
|
|
|
|
ADD COLUMN eth_node_fingerprint VARCHAR(128);
|
|
|
|
|
|
|
|
UPDATE blocks
|
|
|
|
SET eth_node_fingerprint = (
|
|
|
|
SELECT eth_node_id FROM eth_nodes WHERE eth_nodes.id = blocks.eth_node_id
|
|
|
|
);
|
|
|
|
|
|
|
|
ALTER TABLE blocks
|
|
|
|
ALTER COLUMN eth_node_fingerprint SET NOT NULL;
|
|
|
|
|
2019-01-22 12:15:29 +00:00
|
|
|
COMMIT;
|
|
|
|
|
|
|
|
-- +goose Down
|
|
|
|
ALTER TABLE blocks
|
|
|
|
DROP COLUMN eth_node_fingerprint;
|