Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Check the answer: are there any prev migrations? #78

wants to merge 1 commit into from

1 participant


I think we should check the answer to the question:

<question>Are you sure you wish to continue? (y/n)</question>

Otherwise it is not possible to cancel.

@gajdaw gajdaw closed this
@gajdaw gajdaw deleted the gajdaw:previously_executed_migrations branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 21, 2012
  1. @gajdaw
This page is out of date. Refresh to see the latest.
12 lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php
@@ -16,7 +16,7 @@
* and is licensed under the LGPL. For more information, see
* <>.
namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
use Symfony\Component\Console\Input\InputInterface,
@@ -62,11 +62,11 @@ protected function configure()
You can output the would be executed SQL statements to a file with <comment>--write-sql</comment>:
<info>%command.full_name% YYYYMMDDHHMMSS --write-sql</info>
Or you can also execute the migration without a warning message which you need to interact with:
<info>%command.full_name% --no-interaction</info>
@@ -96,6 +96,10 @@ public function execute(InputInterface $input, OutputInterface $output)
if ($noInteraction === false) {
$confirmation = $this->getHelper('dialog')->askConfirmation($output, '<question>Are you sure you wish to continue? (y/n)</question>', false);
+ if ($confirmation !== true) {
+ $output->writeln('<error>Migration cancelled!</error>');
+ return;
+ }
Something went wrong with that request. Please try again.