Skip to content

Commit

Permalink
Merge pull request #5432 from morozov/deprecate-remove-namespaced-assets
Browse files Browse the repository at this point in the history
Deprecate removal of namespaced assets from schema
  • Loading branch information
morozov authored Jun 6, 2022
2 parents 2c39af8 + 74b477c commit 91c0aa7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
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 following components have been deprecated:
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

0 comments on commit 91c0aa7

Please sign in to comment.