Skip to content

Commit

Permalink
feat: fix removed function in doctrine/dbal 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris8934 committed Feb 23, 2024
1 parent 39f6fbd commit eacf9b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Services/DatabaseTools/ORMDatabaseTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,12 @@ protected function createDatabaseIfNotExists(): void
// “An exception occurred in driver: SQLSTATE[HY000] [1049] Unknown database 'test'”

$tmpConnection = DriverManager::getConnection($params);
$tmpConnection->connect();

if (!\in_array($dbName, $tmpConnection->getSchemaManager()->listDatabases(), true)) {
$tmpConnection->getSchemaManager()->createDatabase($dbName);
try {
if (!\in_array($dbName, $tmpConnection->createSchemaManager()->listDatabases(), true)) {
$tmpConnection->createSchemaManager()->createDatabase($dbName);
}
} catch (\Doctrine\DBAL\Platforms\Exception\NotSupported $e) {
}

$tmpConnection->close();
Expand Down

0 comments on commit eacf9b9

Please sign in to comment.