Sequel.migration do up do run "CREATE TABLE `tasks` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `status` varchar(64) NOT NULL DEFAULT 'created', `payload` text, `parent_id` int(11) unsigned DEFAULT NULL, `master_id` int(11) unsigned DEFAULT NULL, `version` tinyint(5) NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `status` (`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;" end down do drop_table :tasks end end