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 removal of namespaced assets from schema #5432

Merged
merged 1 commit into from
Jun 6, 2022
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
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ awareness about deprecated code.

# Upgrade to 3.4

## Deprecated removal of namespaced assets from schema.

The `RemoveNamespacedAssets` schema visitor and the usage of namespaced database object names with the platforms
that don't support them have been deprecated.

## Deprecated the functionality of checking schema for the usage of reserved keywords.

The `dbal:reserved-words` console command and the `ReservedWordsCommand` and `ReservedKeywordsValidator` classes
Expand Down
4 changes: 4 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
-->
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator"/>
<referencedClass name="Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand"/>
<!--
TODO: remove in 4.0.0
-->
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
</errorLevel>
</DeprecatedClass>
<DeprecatedInterface>
Expand Down
15 changes: 14 additions & 1 deletion src/Schema/Visitor/RemoveNamespacedAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table;
use Doctrine\Deprecations\Deprecation;

/**
* Removes assets from a schema that are not in the default namespace.
Expand All @@ -16,13 +17,25 @@
* non default namespaces.
*
* This visitor filters all these non-default namespaced tables and sequences
* and removes them from the SChema instance.
* and removes them from the Schema instance.
*
* @deprecated Do not use namespaces if the target database platform doesn't support them.
*/
class RemoveNamespacedAssets extends AbstractVisitor
{
/** @var Schema|null */
private $schema;

public function __construct()
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/5432',
'RemoveNamespacedAssets is deprecated. Do not use namespaces'
. " if the target database platform doesn't support them."
);
}

/**
* {@inheritdoc}
*/
Expand Down