Sequel.migration do transaction up do run 'ALTER TABLE `functions` ADD CONSTRAINT `function_namespace_id` FOREIGN KEY (`namespace_id`) REFERENCES `namespaces` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE;' end down do run 'ALTER TABLE `functions` DROP FOREIGN KEY `function_namespace_id`;' end end