Skip to content

Commit c537636

Browse files
committed
adding support for databases with other existing tables
1 parent 9540c59 commit c537636

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/chat/src/Bridge/Doctrine/DoctrineDbalMessageStore.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,17 @@ public function setup(array $options = []): void
5353
throw new InvalidArgumentException('No supported options.');
5454
}
5555

56-
$platform = $this->dbalConnection->getDatabasePlatform();
5756
$schemaManager = $this->dbalConnection->createSchemaManager();
5857

59-
$currentSchema = $schemaManager->introspectSchema();
60-
6158
if (class_exists(ComparatorConfig::class)) {
6259
$comparator = $schemaManager->createComparator(new ComparatorConfig(false, false));
6360
} else {
6461
// Backwards compatibility for doctrine/dbal 3.x
6562
$comparator = $schemaManager->createComparator();
6663
}
6764

68-
$migrations = $platform->getAlterSchemaSQL($comparator->compareSchemas($currentSchema, $this->defineTableSchema($currentSchema)));
65+
$currentSchema = $schemaManager->introspectSchema();
66+
$migrations = $this->dbalConnection->getDatabasePlatform()->getAlterSchemaSQL($comparator->compareSchemas($currentSchema, $this->defineTableSchema($currentSchema)));
6967

7068
foreach ($migrations as $sql) {
7169
$this->dbalConnection->executeQuery($sql);

0 commit comments

Comments
 (0)