From 8772c09246972edd183ae28f7f96e5439fdfa5c1 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Sat, 29 Dec 2018 19:55:00 +0200 Subject: [PATCH] Update SchemaUpdateCommand.php --- Command/SchemaUpdateCommand.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Command/SchemaUpdateCommand.php b/Command/SchemaUpdateCommand.php index 6156c3c..23e261e 100644 --- a/Command/SchemaUpdateCommand.php +++ b/Command/SchemaUpdateCommand.php @@ -115,14 +115,16 @@ private function setupModelIndexes(OutputInterface $output, bool $ingoreDuplicat foreach ($indexes as $index) { try { $collection->createIndex($index->getKey(), $index->getOptions()); + + $output->writeln("\t> ".$collection->getCollectionName(), OutputInterface::VERBOSITY_DEBUG); } catch (CommandException $e) { - if ($ingoreDuplicateKeyException) { - $output->writeln('EXCEPTION - '.$e->getMessage()); + if (false == $ingoreDuplicateKeyException) { + throw $e; } + + $output->writeln('EXCEPTION - '.$e->getMessage()); } } - - $output->writeln("\t> ".$collection->getCollectionName(), OutputInterface::VERBOSITY_DEBUG); } } }