/** * Migrate the database schema * * Adjusts the database structure by applying the pending * migrations provided by currently active packages. * * @param string $version The version to migrate to * @param string $output A file to write SQL to, instead of executing it * @param boolean $dryRun Whether to do a dry run or not * @param boolean $quiet If set, only the executed migration versions will be output, one per line * @return void * @see typo3.flow3:doctrine:migrationstatus * @see typo3.flow3:doctrine:migrationexecute * @see typo3.flow3:doctrine:migrationgenerate * @see typo3.flow3:doctrine:migrationversion */ public function migrateCommand($version = NULL, $output = NULL, $dryRun = FALSE, $quiet = FALSE) { // "driver" is used only for Doctrine, thus we (mis-)use it here // additionally, when no path is set, skip this step, assuming no DB is needed if ($this->settings['backendOptions']['driver'] !== NULL && $this->settings['backendOptions']['host'] !== NULL) { $result = $this->doctrineService->executeMigrations($version, $output, $dryRun, $quiet); if ($result == '') { if (!$quiet) { $this->outputLine('No migration was necessary.'); } } elseif ($output === NULL) { $this->outputLine($result); } else { if (!$quiet) { $this->outputLine('Wrote migration SQL to file "' . $output . '".'); } } } else { $this->outputLine('Doctrine migration not possible, the driver and host backend options are not set in /Configuration/Settings.yaml.'); $this->quit(1); } }