executeMigrations() public method

If $outputPathAndFilename is given, the SQL statements will be written to the given file instead of executed.
public executeMigrations ( string $version = null, string $outputPathAndFilename = null, boolean $dryRun = false, boolean $quiet = false ) : string
$version string The version to migrate to
$outputPathAndFilename string A file to write SQL to, instead of executing it
$dryRun boolean Whether to do a dry run or not
$quiet boolean Whether to do a quiet run or not
return string
Ejemplo n.º 1
0
 /**
  * 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);
     }
 }