From 40322c6de47b705f29b145f5bf6bdcbfcab83932 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Mon, 19 Nov 2018 00:32:12 +0100 Subject: [PATCH] fix importer for MySQL #428 (#429) --- src/Command/KimaiImporterCommand.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Command/KimaiImporterCommand.php b/src/Command/KimaiImporterCommand.php index 73a57bcb..3cb3d33f 100644 --- a/src/Command/KimaiImporterCommand.php +++ b/src/Command/KimaiImporterCommand.php @@ -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();