Skip to content

Commit

Permalink
Merge pull request #205 from storyn26383/patch-1
Browse files Browse the repository at this point in the history
If migrations exist, set default confirm answer to no.
  • Loading branch information
santigarcor committed Oct 4, 2017
2 parents 09393ca + 509945b commit a561688
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Commands/MigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,19 @@ public function handle()
$this->comment($this->generateMigrationMessage());

$existingMigrations = $this->alreadyExistingMigrations();
$defaultAnswer = true;

if ($existingMigrations) {
$this->line('');

$this->warn($this->getExistingMigrationsWarning($existingMigrations));

$defaultAnswer = false;
}

$this->line('');

if (! $this->confirm("Proceed with the migration creation?", "yes")) {
if (! $this->confirm("Proceed with the migration creation?", $defaultAnswer)) {
return;
}

Expand Down

0 comments on commit a561688

Please sign in to comment.