query("CREATE TABLE {schedules} ( `id` int(9) NOT NULL auto_increment, `name` varchar(128) NOT NULL, `task_callback` varchar(128) NOT NULL, `task_id` int(9) NULL, `next_run_datetime` int(9) NOT NULL, `interval` int(9) NOT NULL, `busy` bool NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `run_date` (`next_run_datetime`, `busy`), UNIQUE KEY (`name`)) DEFAULT CHARSET=utf8;"); module::set_version("scheduler", $version = 1); } static function uninstall() { $db = Database::instance(); $db->query("DROP TABLE IF EXISTS {schedules}"); } }