ipld-eth-server/db/migrations/1513275969_add_cascade_delete_to_blocks.up.sql

12 lines
170 B
MySQL
Raw Normal View History

BEGIN;
ALTER TABLE blocks
DROP CONSTRAINT node_fk;
ALTER TABLE blocks
ADD CONSTRAINT node_fk
FOREIGN KEY (node_id)
REFERENCES nodes (id)
ON DELETE CASCADE;
COMMIT;