migration for applying log_cids.leaf_mh_key FK constraint to check that repair process was completed

This commit is contained in:
i-norden 2022-01-19 15:21:29 -06:00
parent 6612edabbe
commit edabfcc9c9
10 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,9 @@
-- +goose Up
ALTER TABLE eth.log_cids
ADD CONSTRAINT fk_log_leaf_mh_key
FOREIGN KEY (leaf_mh_key) REFERENCES public.blocks (key)
ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-- +goose Down
ALTER TABLE eth.log_cids
DROP CONSTRAINT fk_log_leaf_mh_key;

View File

@ -21,7 +21,15 @@ WHERE indrelid = (
WHERE relname='eth.header_cids'
);
ALTER TABLE eth.log_cids
DROP CONSTRAINT fk_log_leaf_mh_key;
-- +goose Down
ALTER TABLE eth.log_cids
ADD CONSTRAINT fk_log_leaf_mh_key
FOREIGN KEY (leaf_mh_key) REFERENCES public.blocks (key)
ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
UPDATE pg_index
SET indisready=true
WHERE indrelid = (