output->writeln('Checking database version'); $versions = new Versions(['git' => ($this->git instanceof Git) ? $this->git : null]); try { $currentDb = $versions->getSQLPatchFromDB(); $currentXML = $versions->getSQLPatchFromFile(); } catch (\PDOException $e) { $this->error('Error fetching patch versions!'); return 1; } $this->info("Db: $currentDb,\tFile: $currentXML"); if ($currentDb < $currentXML) { $db = new DbUpdate(['backup' => false]); $db->processPatches(['safe' => false]); } else { $this->info('Up to date.'); } } }