Internal: Installer: Catch exception when dropping database and it does not exist

pull/4692/head
Angel Fernando Quiroz Campos 3 years ago
parent b20fc4bcca
commit 37abba392b
  1. 8
      public/main/install/index.php

@ -517,7 +517,13 @@ if (isset($_POST['step2'])) {
// Drop and create the database anyways
error_log("Drop database $dbNameForm");
$schemaManager = $manager->getConnection()->createSchemaManager();
$schemaManager->dropDatabase($dbNameForm);
try {
$schemaManager->dropDatabase($dbNameForm);
} catch (\Doctrine\DBAL\Exception $e) {
error_log("Database ".$dbNameForm." does not exists");
}
$schemaManager->createDatabase($dbNameForm);
error_log("Connect to database $dbNameForm with user $dbUsernameForm");

Loading…
Cancel
Save