Skip to content

Commit

Permalink
Merge pull request #11354 from greg0ire/depr--complete
Browse files Browse the repository at this point in the history
Deprecate --complete option of orm:schema-tool:update
  • Loading branch information
greg0ire committed Mar 15, 2024
2 parents 716fc97 + 68f9bf5 commit 25d5936
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Upgrade to 3.2

## `orm:schema-tool:update` option `--complete` is deprecated

That option behaves as a no-op, and is deprecated. It will be removed in 4.0.

# Upgrade to 3.1

## Deprecate `Doctrine\ORM\Mapping\ReflectionEnumProperty`
Expand Down
12 changes: 11 additions & 1 deletion src/Tools/Console/Command/SchemaTool/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;

use Doctrine\Deprecations\Deprecation;
use Doctrine\ORM\Tools\SchemaTool;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -28,7 +29,7 @@ protected function configure(): void
$this->setName($this->name)
->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('complete', null, InputOption::VALUE_NONE, 'This option is a no-op and will be removed in 4.0')
->addOption('complete', null, InputOption::VALUE_NONE, 'This option is a no-op, is deprecated and will be removed in 4.0')
->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Dumps the generated SQL statements to the screen (does not execute them).')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Causes the generated SQL statements to be physically executed against your database.')
->setHelp(<<<'EOT'
Expand Down Expand Up @@ -75,6 +76,15 @@ protected function executeSchemaCommand(InputInterface $input, OutputInterface $
{
$notificationUi = $ui->getErrorStyle();

if ($input->getOption('complete') === true) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/pull/11354',
'The --complete option is a no-op, is deprecated and will be removed in Doctrine ORM 4.0.',
);
$notificationUi->warning('The --complete option is a no-op, is deprecated and will be removed in Doctrine ORM 4.0.');
}

$sqls = $schemaTool->getUpdateSchemaSql($metadatas);

if (empty($sqls)) {
Expand Down

0 comments on commit 25d5936

Please sign in to comment.