setName("migrate:rollback") ->setDescription("Rollback last database migration") ->addOption('steps', 's', InputOption::VALUE_REQUIRED, 'Number of steps to rollback', 1) ->addOption('sprinkle', NULL, InputOption::VALUE_REQUIRED, 'The sprinkle to rollback', "") ->addOption('pretend', 'p', InputOption::VALUE_NONE, 'Run migrations in "dry run" mode'); } /** * {@inheritDoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $this->io->title("Migration rollback"); $step = $input->getOption('steps'); $sprinkle = $input->getOption('sprinkle'); $pretend = $input->getOption('pretend'); $migrator = new Migrator($this->io, $this->ci); $migrator->runDown($step, $sprinkle, $pretend); } }