protected function migrateToTime(RequestApplicationInterface $app, $time)
    {
        return $this->getMigrationHistory(null)->then(
            function($migrations) use ($app, $time) {
                $migrations = array_values($migrations);
                $count = 0;
                while ($count < count($migrations) && $migrations[$count] > $time) {
                    ++$count;
                }
                if ($count === 0) {
                    $this->stdout("Nothing needs to be done.\n", Console::FG_GREEN);
                } else {
                    return $this->actionDown($app, $count);
                }
                return reject(new Exception("Nothing needs to be done"));
            }
        );
    }