mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-23 08:06:33 +00:00
Fix database already exist detection
This is not the same message exception from MySQL & SQLite with Postgres.
This commit is contained in:
parent
4529d0f4b6
commit
54a2241e13
1 changed files with 6 additions and 0 deletions
|
@ -283,10 +283,16 @@ class InstallCommand extends ContainerAwareCommand
|
|||
try {
|
||||
$schemaManager = $connection->getSchemaManager();
|
||||
} catch (\Exception $exception) {
|
||||
// mysql & sqlite
|
||||
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// pgsql
|
||||
if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue