2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Up
|
2019-07-18 21:24:25 +00:00
|
|
|
ALTER TABLE full_sync_logs
|
|
|
|
DROP CONSTRAINT full_sync_log_uc;
|
2018-01-15 21:27:45 +00:00
|
|
|
|
2019-07-18 21:24:25 +00:00
|
|
|
ALTER TABLE full_sync_logs
|
2018-01-15 21:27:45 +00:00
|
|
|
ADD COLUMN receipt_id INT;
|
|
|
|
|
2019-07-18 21:24:25 +00:00
|
|
|
ALTER TABLE full_sync_logs
|
2018-01-15 21:27:45 +00:00
|
|
|
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
|
2019-07-18 21:24:25 +00:00
|
|
|
ALTER TABLE full_sync_logs
|
2019-01-22 12:15:29 +00:00
|
|
|
DROP CONSTRAINT receipts_fk;
|
|
|
|
|
2019-07-18 21:24:25 +00:00
|
|
|
ALTER TABLE full_sync_logs
|
2019-01-22 12:15:29 +00:00
|
|
|
DROP COLUMN receipt_id;
|
|
|
|
|
2019-07-18 21:24:25 +00:00
|
|
|
ALTER TABLE full_sync_logs
|
|
|
|
ADD CONSTRAINT full_sync_log_uc UNIQUE (block_number, index);
|