ipld-eth-server/db/migrations/00016_add_receipts_fk_to_logs.sql

24 lines
492 B
MySQL
Raw Normal View History

-- +goose Up
ALTER TABLE full_sync_logs
DROP CONSTRAINT full_sync_log_uc;
2018-01-15 21:27:45 +00:00
ALTER TABLE full_sync_logs
2018-01-15 21:27:45 +00:00
ADD COLUMN receipt_id INT;
ALTER TABLE full_sync_logs
2018-01-15 21:27:45 +00:00
ADD CONSTRAINT receipts_fk
FOREIGN KEY (receipt_id)
REFERENCES full_sync_receipts (id)
2018-01-15 21:27:45 +00:00
ON DELETE CASCADE;
-- +goose Down
ALTER TABLE full_sync_logs
DROP CONSTRAINT receipts_fk;
ALTER TABLE full_sync_logs
DROP COLUMN receipt_id;
ALTER TABLE full_sync_logs
ADD CONSTRAINT full_sync_log_uc UNIQUE (block_number, index);