Execute a single migration in up or down direction. If $path is given, the
SQL statements will be written to the file in $path instead of executed.
public executeMigration ( string $version, string $direction = 'up', string $outputPathAndFilename = null, boolean $dryRun = false ) : string | ||
$version | string | The version to migrate to |
$direction | string | |
$outputPathAndFilename | string | A file to write SQL to, instead of executing it |
$dryRun | boolean | Whether to do a dry run or not |
return | string |
/** * Execute a single migration * * Manually runs a single migration in the given direction. * * @param string $version The migration to execute * @param string $direction Whether to execute the migration up (default) or down * @param string $output A file to write SQL to, instead of executing it * @param boolean $dryRun Whether to do a dry run or not * @return void * @see neos.flow:doctrine:migrate * @see neos.flow:doctrine:migrationstatus * @see neos.flow:doctrine:migrationgenerate * @see neos.flow:doctrine:migrationversion */ public function migrationExecuteCommand($version, $direction = 'up', $output = null, $dryRun = 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 { $this->outputLine($this->doctrineService->executeMigration($version, $direction, $output, $dryRun)); } catch (\Exception $exception) { $this->handleException($exception); } }