Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate --complete option of orm:schema-tool:update #11354

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
$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')

Check warning on line 32 in src/Tools/Console/Command/SchemaTool/UpdateCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Tools/Console/Command/SchemaTool/UpdateCommand.php#L32

Added line #L32 was not covered by tests
->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 @@
{
$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.');

Check warning on line 85 in src/Tools/Console/Command/SchemaTool/UpdateCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Tools/Console/Command/SchemaTool/UpdateCommand.php#L79-L85

Added lines #L79 - L85 were not covered by tests
}

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

if (empty($sqls)) {
Expand Down
Loading