ipld-eth-server/db/migrations/1516050071_add_log_fk_constraint.up.sql

14 lines
223 B
MySQL
Raw Normal View History

2018-01-15 21:27:45 +00:00
BEGIN;
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)
REFERENCES receipts (id)
ON DELETE CASCADE;
COMMIT;