From 039293c27ad4183237c2ddd89f11deab6c7d6485 Mon Sep 17 00:00:00 2001 From: beberlei Date: Sat, 25 Sep 2010 12:12:19 +0200 Subject: [PATCH] DDC-816 - Fix output of warning message in update and drop schema-tool commands --- .../ORM/Tools/Console/Command/SchemaTool/DropCommand.php | 4 ++-- .../Tools/Console/Command/SchemaTool/UpdateCommand.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php index 6e4811b0eb5..df6167d64e7 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 @@ protected function configure() 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 @@ protected function executeSchemaCommand(InputInterface $input, OutputInterface $ $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 0677347f935..f553a8c4b95 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 @@ protected function configure() 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 @@ protected function executeSchemaCommand(InputInterface $input, OutputInterface $ $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)) {