fix importer for MySQL #428 (#429)

This commit is contained in:
Kevin Papst
2018-11-19 00:32:12 +01:00
committed by GitHub
parent 417675b3df
commit 40322c6de4

View File

@@ -318,19 +318,22 @@ class KimaiImporterCommand extends Command
*/
protected function checkDatabaseVersion(SymfonyStyle $io, $requiredVersion, $requiredRevision)
{
$optionColumn = $this->connection->quoteIdentifier('option');
$qb = $this->connection->createQueryBuilder();
$version = $this->connection->createQueryBuilder()
->select('value')
->from($this->connection->quoteIdentifier($this->dbPrefix . 'configuration'))
->where('option = :option')
->setParameter(':option', 'version')
->where($qb->expr()->eq($optionColumn, ':option'))
->setParameter('option', 'version')
->execute()
->fetchColumn();
$revision = $this->connection->createQueryBuilder()
->select('value')
->from($this->connection->quoteIdentifier($this->dbPrefix . 'configuration'))
->where('option = :option')
->setParameter(':option', 'revision')
->where($qb->expr()->eq($optionColumn, ':option'))
->setParameter('option', 'revision')
->execute()
->fetchColumn();