diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php index 6e4811b0e..df6167d64 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php @@ -70,8 +70,6 @@ EOT protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas) { - $output->write('ATTENTION: This operation should not be executed in an production enviroment.' . PHP_EOL . PHP_EOL); - if ($input->getOption('dump-sql') === true) { $sqls = $schemaTool->getDropSchemaSql($metadatas); $output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL); @@ -80,6 +78,8 @@ EOT $schemaTool->dropSchema($metadatas); $output->write('Database schema dropped successfully!' . PHP_EOL); } else { + $output->write('ATTENTION: This operation should not be executed in an production enviroment.' . PHP_EOL . PHP_EOL); + $sqls = $schemaTool->getDropSchemaSql($metadatas); if (count($sqls)) { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php index 0677347f9..f553a8c4b 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php @@ -75,10 +75,6 @@ EOT protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas) { - $output->write('ATTENTION: This operation should not be executed in an production enviroment.' . PHP_EOL); - $output->write('Use the incremental update to detect changes during development and use' . PHP_EOL); - $output->write('this SQL DDL to manually update your database in production.' . PHP_EOL . PHP_EOL); - // Defining if update is complete or not (--complete not defined means $saveMode = true) $saveMode = ($input->getOption('complete') !== true); @@ -90,6 +86,10 @@ EOT $schemaTool->updateSchema($metadatas, $saveMode); $output->write('Database schema updated successfully!' . PHP_EOL); } else { + $output->write('ATTENTION: This operation should not be executed in an production enviroment.' . PHP_EOL); + $output->write('Use the incremental update to detect changes during development and use' . PHP_EOL); + $output->write('this SQL DDL to manually update your database in production.' . PHP_EOL . PHP_EOL); + $sqls = $schemaTool->getUpdateSchemaSql($metadatas, $saveMode); if (count($sqls)) {