forked from wallabag/wallabag
Fix database already exist detection
This is not the same message exception from MySQL & SQLite with Postgres.
This commit is contained in:
@ -283,10 +283,16 @@ class InstallCommand extends ContainerAwareCommand
|
|||||||
try {
|
try {
|
||||||
$schemaManager = $connection->getSchemaManager();
|
$schemaManager = $connection->getSchemaManager();
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
|
// mysql & sqlite
|
||||||
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
|
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pgsql
|
||||||
|
if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user