bug #31625 [Messenger] Disable the SchemaAssetsFilter when setup the transport (vincenttouzet)
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Disable the SchemaAssetsFilter when setup the transport
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31623
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
8cbb8f89ad
[Messenger] Disable the SchemaAssetsFilter when setup the transport
This commit is contained in:
commit
e19de5455f
|
@ -108,7 +108,10 @@ class ConnectionTest extends TestCase
|
|||
$platform = $this->getMockBuilder(AbstractPlatform::class)
|
||||
->getMock();
|
||||
$platform->method('getWriteLockSQL')->willReturn('FOR UPDATE');
|
||||
$configuration = $this->getMockBuilder(\Doctrine\DBAL\Configuration::class)
|
||||
->getMock();
|
||||
$driverConnection->method('getDatabasePlatform')->willReturn($platform);
|
||||
$driverConnection->method('getConfiguration')->willReturn($configuration);
|
||||
|
||||
return $driverConnection;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,25 @@ class Connection
|
|||
|
||||
public function setup(): void
|
||||
{
|
||||
$configuration = $this->driverConnection->getConfiguration();
|
||||
// Since Doctrine 2.9 the getFilterSchemaAssetsExpression is deprecated
|
||||
$hasFilterCallback = method_exists($configuration, 'getSchemaAssetsFilter');
|
||||
|
||||
if ($hasFilterCallback) {
|
||||
$assetFilter = $this->driverConnection->getConfiguration()->getSchemaAssetsFilter();
|
||||
$this->driverConnection->getConfiguration()->setSchemaAssetsFilter(null);
|
||||
} else {
|
||||
$assetFilter = $this->driverConnection->getConfiguration()->getFilterSchemaAssetsExpression();
|
||||
$this->driverConnection->getConfiguration()->setFilterSchemaAssetsExpression(null);
|
||||
}
|
||||
|
||||
$this->schemaSynchronizer->updateSchema($this->getSchema(), true);
|
||||
|
||||
if ($hasFilterCallback) {
|
||||
$this->driverConnection->getConfiguration()->setSchemaAssetsFilter($assetFilter);
|
||||
} else {
|
||||
$this->driverConnection->getConfiguration()->setFilterSchemaAssetsExpression($assetFilter);
|
||||
}
|
||||
}
|
||||
|
||||
public function getMessageCount(): int
|
||||
|
|
Reference in New Issue