Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function migrate(OptionsInterface $options)
 {
     $command = new MigrateCommand($this->getMigration(), $options);
     $this->getMigrationBus()->handle($command);
     $this->migrated = $options->getDirection()->isUp();
 }
Esempio n. 2
0
 /**
  * Returns true if the operation is forced, or if the direction is the opposite to the state of the migration.
  *
  * @param DeltaInterface $version
  * @param OptionsInterface $options
  *
  * @return bool
  */
 protected function shouldMigrate(DeltaInterface $version, OptionsInterface $options)
 {
     return $options->isForced() || $options->getDirection()->isUp() ^ $version->isMigrated();
     // direction is opposite to state
 }