Remove calls to AbstractPlatform::canEmulateSchemas() #6834

Open
opened 2026-01-22 15:39:46 +01:00 by admin · 2 comments
Owner

Originally created by @derrabus on GitHub (Sep 19, 2021).

DBAL is going to remove AbstractPlatform::canEmulateSchemas(), so we should not call it anymore.

doctrine/dbal#4805

Originally created by @derrabus on GitHub (Sep 19, 2021). DBAL is going to remove `AbstractPlatform::canEmulateSchemas()`, so we should not call it anymore. doctrine/dbal#4805
admin added the Deprecation label 2026-01-22 15:39:46 +01:00
Author
Owner

@beberlei commented on GitHub (Dec 12, 2021):

Its just a deprecation for now, we can unschedule for 2.11 for now.

@beberlei commented on GitHub (Dec 12, 2021): Its just a deprecation for now, we can unschedule for 2.11 for now.
Author
Owner

@counteraccro commented on GitHub (Nov 12, 2024):

Hello,
I just encountered this deprecation on my project in Synfony 7.1.7 when migrating from postgreSql to Mysql

The deprecation:

User Deprecated: AbstractPlatform::canEmulateSchemas() is deprecated. (AbstractPlatform.php:4178 called by DefaultQuoteStrategy.php:46, https://github.com/doctrine/dbal/pull/4805, package doctrine/dbal)

After a quick search in the code, I found 2 places where the deprecation is present.

in vendor/doctrine/orm/src/Mapping/DefaultQuoteStrategy.php line 46

 // @phpstan-ignore method.deprecated
            if (! $platform->supportsSchemas() && $platform->canEmulateSchemas()) {
                $tableName = $class->table['schema'] . '__' . $class->table['name'];
            }

In vendor/doctrine/orm/src/Tools/SchemaTool.php line 417

// @phpstan-ignore method.deprecated
            if (array_filter($schema->getSequences() + $schema->getTables(), $filter) && ! $this->platform->canEmulateSchemas()) {
                // @phpstan-ignore method.deprecated, new.deprecated
                $schema->visit(new RemoveNamespacedAssets());
            }

I did not find anything in my code that I can fix myself.

Is there any plan to fix this deprecation soon?

Thank you in advance for your feedback

@counteraccro commented on GitHub (Nov 12, 2024): Hello, I just encountered this deprecation on my project in Synfony 7.1.7 when migrating from postgreSql to Mysql The deprecation: ```` User Deprecated: AbstractPlatform::canEmulateSchemas() is deprecated. (AbstractPlatform.php:4178 called by DefaultQuoteStrategy.php:46, https://github.com/doctrine/dbal/pull/4805, package doctrine/dbal) ```` After a quick search in the code, I found 2 places where the deprecation is present. in vendor/doctrine/orm/src/Mapping/DefaultQuoteStrategy.php line 46 ````php // @phpstan-ignore method.deprecated if (! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { $tableName = $class->table['schema'] . '__' . $class->table['name']; } ```` In vendor/doctrine/orm/src/Tools/SchemaTool.php line 417 ````php // @phpstan-ignore method.deprecated if (array_filter($schema->getSequences() + $schema->getTables(), $filter) && ! $this->platform->canEmulateSchemas()) { // @phpstan-ignore method.deprecated, new.deprecated $schema->visit(new RemoveNamespacedAssets()); } ```` I did not find anything in my code that I can fix myself. Is there any plan to fix this deprecation soon? Thank you in advance for your feedback
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6834