/** * 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 typo3.flow:doctrine:migrate * @see typo3.flow:doctrine:migrationstatus * @see typo3.flow:doctrine:migrationgenerate * @see typo3.flow:doctrine:migrationversion */ public function migrationExecuteCommand($version, $direction = 'up', $output = NULL, $dryRun = 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) { $this->outputLine($this->doctrineService->executeMigration($version, $direction, $output, $dryRun)); } else { $this->outputLine('Doctrine migration not possible, the driver and host backend options are not set in /Configuration/Settings.yaml.'); $this->quit(1); } }
/** * 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 typo3.flow:doctrine:migrate * @see typo3.flow:doctrine:migrationstatus * @see typo3.flow:doctrine:migrationgenerate * @see typo3.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); } }