2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Up
|
2018-01-16 15:28:19 +00:00
|
|
|
ALTER TABLE logs
|
|
|
|
DROP CONSTRAINT log_uc;
|
2018-01-15 21:27:45 +00:00
|
|
|
|
|
|
|
ALTER TABLE logs
|
|
|
|
ADD COLUMN receipt_id INT;
|
|
|
|
|
|
|
|
ALTER TABLE logs
|
|
|
|
ADD CONSTRAINT receipts_fk
|
|
|
|
FOREIGN KEY (receipt_id)
|
2019-03-22 03:43:06 +00:00
|
|
|
REFERENCES full_sync_receipts (id)
|
2018-01-15 21:27:45 +00:00
|
|
|
ON DELETE CASCADE;
|
|
|
|
|
2019-01-22 12:15:29 +00:00
|
|
|
|
|
|
|
-- +goose Down
|
|
|
|
ALTER TABLE logs
|
|
|
|
DROP CONSTRAINT receipts_fk;
|
|
|
|
|
|
|
|
ALTER TABLE logs
|
|
|
|
DROP COLUMN receipt_id;
|
|
|
|
|
|
|
|
ALTER TABLE logs
|
|
|
|
ADD CONSTRAINT log_uc UNIQUE (block_number, index);
|