From 54a2241e136ccf90c659b5699af4489b6e4d2da1 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 24 Oct 2015 15:27:34 +0200 Subject: [PATCH] Fix database already exist detection This is not the same message exception from MySQL & SQLite with Postgres. --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 808baaf6..865a73e1 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -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; } -- 2.41.0