Cml\Console\Commands\Migrate\Rollback::execute PHP Метод

execute() публичный Метод

回滚迁移
public execute ( array $args, array $options = [] )
$args array 参数
$options array 选项
    public function execute(array $args, array $options = [])
    {
        $this->bootstrap($args, $options);
        $version = isset($options['target']) ? $options['target'] : $options['t'];
        $date = isset($options['date']) ? $options['date'] : $options['d'];
        $force = isset($options['force']) ? $options['force'] : $options['f'];
        // rollback the specified environment
        $start = microtime(true);
        if (null !== $date) {
            $this->getManager()->rollbackToDateTime(new \DateTime($date), $force);
        } else {
            $this->getManager()->rollback($version, $force);
        }
        $end = microtime(true);
        Output::writeln('');
        Output::writeln(Colour::colour('All Done. Took ', Colour::GREEN) . sprintf('%.4fs', $end - $start));
    }
Rollback