Skip to content
This repository

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

Closed
wants to merge 1 commit into from

1 participant

Włodzimierz Gajda
Włodzimierz Gajda
gajdaw commented June 21, 2012

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.

Włodzimierz Gajda gajdaw closed this April 29, 2013
Włodzimierz Gajda gajdaw deleted the branch April 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 21, 2012
Włodzimierz Gajda Check the answer: are there any prev migrations? 6aa6862
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 @@
16 16
  * and is licensed under the LGPL. For more information, see
17 17
  * <http://www.doctrine-project.org>.
18 18
  */
19  
- 
  19
+
20 20
 namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
21 21
 
22 22
 use Symfony\Component\Console\Input\InputInterface,
@@ -62,11 +62,11 @@ protected function configure()
62 62
 You can output the would be executed SQL statements to a file with <comment>--write-sql</comment>:
63 63
 
64 64
     <info>%command.full_name% YYYYMMDDHHMMSS --write-sql</info>
65  
-    
  65
+
66 66
 Or you can also execute the migration without a warning message which you need to interact with:
67  
-    
  67
+
68 68
     <info>%command.full_name% --no-interaction</info>
69  
-    
  69
+
70 70
 EOT
71 71
         );
72 72
 
@@ -96,6 +96,10 @@ public function execute(InputInterface $input, OutputInterface $output)
96 96
 
97 97
             if ($noInteraction === false) {
98 98
                 $confirmation = $this->getHelper('dialog')->askConfirmation($output, '<question>Are you sure you wish to continue? (y/n)</question>', false);
  99
+                if ($confirmation !== true) {
  100
+                    $output->writeln('<error>Migration cancelled!</error>');
  101
+                    return;
  102
+                }
99 103
             }
100 104
         }
101 105
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.