Enhance Schema-Tool commands by being more aggresive on warning the user that these commands do stuff that can be potentially dangerous to the database (and its contents).
This commit is contained in:
parent
6d20d7d5ed
commit
62a8e2aad5
@ -65,6 +65,8 @@ 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->getCreateSchemaSql($metadatas);
|
||||
$output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL);
|
||||
|
@ -70,6 +70,8 @@ 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);
|
||||
|
@ -62,7 +62,7 @@ class UpdateCommand extends AbstractCommand
|
||||
),
|
||||
new InputOption(
|
||||
'force', null, InputOption::PARAMETER_NONE,
|
||||
"Don't ask for the deletion of the database, but force the operation to run."
|
||||
"Don't ask for the incremental update of the database, but force the operation to run."
|
||||
),
|
||||
))
|
||||
->setHelp(<<<EOT
|
||||
@ -75,6 +75,10 @@ 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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user