diff --git a/UPGRADE.md b/UPGRADE.md index 01020b90a9a..7d49322ca8e 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -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` diff --git a/src/Tools/Console/Command/SchemaTool/UpdateCommand.php b/src/Tools/Console/Command/SchemaTool/UpdateCommand.php index 9d490b4cb59..f35fc384536 100644 --- a/src/Tools/Console/Command/SchemaTool/UpdateCommand.php +++ b/src/Tools/Console/Command/SchemaTool/UpdateCommand.php @@ -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; @@ -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' @@ -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)) {