コード例 #1
0
ファイル: Delta.php プロジェクト: baleen/migrations
 /**
  * @inheritdoc
  */
 public function migrate(OptionsInterface $options)
 {
     $command = new MigrateCommand($this->getMigration(), $options);
     $this->getMigrationBus()->handle($command);
     $this->migrated = $options->getDirection()->isUp();
 }
コード例 #2
0
 /**
  * Returns true if the operation is forced, or if the direction is the opposite to the state of the migration.
  *
  * @param VersionInterface $version
  * @param OptionsInterface $options
  *
  * @return bool
  */
 protected function shouldMigrate(VersionInterface $version, OptionsInterface $options)
 {
     return $options->isForced() || $options->isDirectionUp() ^ $version->isMigrated();
     // direction is opposite to state
 }