/** * @inheritdoc */ public function migrate(OptionsInterface $options) { $command = new MigrateCommand($this->getMigration(), $options); $this->getMigrationBus()->handle($command); $this->migrated = $options->getDirection()->isUp(); }
/** * 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 }