Skip to content

Commit

Permalink
DDC-816 - Fix output of warning message in update and drop schema-too…
Browse files Browse the repository at this point in the history
…l commands
  • Loading branch information
beberlei committed Sep 25, 2010
1 parent 8f80c94 commit 039293c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -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);
Expand All @@ -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)) {
Expand Down
Expand Up @@ -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);

Expand All @@ -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)) {
Expand Down

0 comments on commit 039293c

Please sign in to comment.