/**
* 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 neos.flow:doctrine:migrationstatus
* @see neos.flow:doctrine:migrationexecute
* @see neos.flow:doctrine:migrationgenerate
* @see neos.flow:doctrine:migrationversion
*/
public function migrateCommand($version = null, $output = null, $dryRun = false, $quiet = false)
{
if (!$this->isDatabaseConfigured()) {
$this->outputLine('Doctrine migration not possible, the driver and host backend options are not set in /Configuration/Settings.yaml.');
$this->quit(1);
}
try {
$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 . '".');
}
}
$this->emitAfterDatabaseMigration();
} catch (\Exception $exception) {
$this->handleException($exception);
}
}