]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix database already exist detection
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 24 Oct 2015 13:27:34 +0000 (15:27 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 7 Nov 2015 13:15:33 +0000 (14:15 +0100)
This is not the same message exception from MySQL & SQLite with Postgres.

src/Wallabag/CoreBundle/Command/InstallCommand.php

index 808baaf68ec7257270d620d1028cfa763ce59377..865a73e1db215c56fd137757d4d8643e8a6df507 100644 (file)
@@ -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;
         }