Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 22dab67

Browse filesBrowse files
committed
[Messenger] Make Doctrine connection ignore unrelated tables on setup
1 parent 07b279c commit 22dab67
Copy full SHA for 22dab67

File tree

2 files changed

+2
-1
lines changed
Filter options

2 files changed

+2
-1
lines changed

‎src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ public function testItRetrieveTheMessageThatIsOlderThanRedeliverTimeout()
205205

206206
public function testTheTransportIsSetupOnGet()
207207
{
208+
$this->driverConnection->executeStatement('CREATE TABLE unrelated (unknown_type_column)');
208209
$this->assertFalse($this->createSchemaManager()->tablesExist(['messenger_messages']));
209210
$this->assertNull($this->connection->get());
210211

‎src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function setup(): void
289289
{
290290
$configuration = $this->driverConnection->getConfiguration();
291291
$assetFilter = $configuration->getSchemaAssetsFilter();
292-
$configuration->setSchemaAssetsFilter(static function () { return true; });
292+
$configuration->setSchemaAssetsFilter(function (string $tableName) { return $tableName === $this->configuration['table_name']; });
293293
$this->updateSchema();
294294
$configuration->setSchemaAssetsFilter($assetFilter);
295295
$this->autoSetup = false;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.