ipld-eth-server/db/migrations/00030_update_node_index.sql

23 lines
335 B
PL/PgSQL

-- +goose Up
BEGIN;
ALTER TABLE nodes
DROP CONSTRAINT node_uc;
ALTER TABLE nodes
ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id, node_id);
COMMIT;
-- +goose Down
-- +goose Up
BEGIN;
ALTER TABLE nodes
DROP CONSTRAINT node_uc;
ALTER TABLE nodes
ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id);
COMMIT;