fix sqlite installer (#1283)

This commit is contained in:
Kevin Papst
2019-11-26 19:32:16 +01:00
committed by GitHub
parent 5ee0396a02
commit fdf4fdfb6a
2 changed files with 6 additions and 6 deletions

View File

@@ -146,8 +146,13 @@ final class InstallCommand extends Command
throw new \Exception('Skipped database creation, aborting installation');
}
$options = [];
if ($this->connection->getDatabasePlatform()->getName() !== 'sqlite') {
$options = ['--if-not-exists' => true];
}
$command = $this->getApplication()->find('doctrine:database:create');
$result = $command->run(new ArrayInput(['--if-not-exists' => true]), $output);
$result = $command->run(new ArrayInput($options), $output);
if (0 !== $result) {
throw new \Exception('Failed creating database. Check your credentials in DATABASE_URL');