public function markAsMigrated($version, $markAsMigrated)
    {
        $configuration = $this->getMigrationConfiguration();

        if ($version === 'all') {
            foreach ($configuration->getMigrations() as $version) {
                if ($markAsMigrated === true && $configuration->hasVersionMigrated($version) === false) {
                    $version->markMigrated();
                } elseif ($markAsMigrated === false && $configuration->hasVersionMigrated($version) === true) {
                    $version->markNotMigrated();
                }
            }
        } else {
            if ($configuration->hasVersion($version) === false) {
                throw MigrationException::unknownMigrationVersion($version);
            }

            $version = $configuration->getVersion($version);

            if ($markAsMigrated === true) {
                if ($configuration->hasVersionMigrated($version) === true) {
                    throw new MigrationException(sprintf('The version "%s" is already marked as executed.', $version));
                }
                $version->markMigrated();
            } else {
                if ($configuration->hasVersionMigrated($version) === false) {
                    throw new MigrationException(sprintf('The version "%s" is already marked as not executed.', $version));
                }
                $version->markNotMigrated();
            }
        }
    }
public function markAsMigrated($version, $markAsMigrated)
    {
        $configuration = $this->getMigrationConfiguration();

        if ($version === 'all') {
            foreach ($configuration->getMigrations() as $version) {
                if ($markAsMigrated === true && $configuration->hasVersionMigrated($version) === false) {
                    $version->markMigrated();
                } elseif ($markAsMigrated === false && $configuration->hasVersionMigrated($version) === true) {
                    $version->markNotMigrated();
                }
            }
        } else {
            if ($configuration->hasVersion($version) === false) {
                throw MigrationException::unknownMigrationVersion($version);
            }

            $version = $configuration->getVersion($version);

            if ($markAsMigrated === true) {
                if ($configuration->hasVersionMigrated($version) === true) {
                    throw new MigrationException(sprintf('The version "%s" is already marked as executed.', $version));
                }
                $version->markMigrated();
            } else {
                if ($configuration->hasVersionMigrated($version) === false) {
                    throw new MigrationException(sprintf('The version "%s" is already marked as not executed.', $version));
                }
                $version->markNotMigrated();
            }
        }
    }
public function markAsMigrated ( $ version , $ markAsMigrated ) { $ configuration = $ this -> getMigrationConfiguration ( ) ; if ( $ version === 'all' ) { foreach ( $ configuration -> getMigrations ( ) as $ version ) { if ( $ markAsMigrated === true && $ configuration -> hasVersionMigrated ( $ version ) === false ) { $ version -> markMigrated ( ) ; } elseif ( $ markAsMigrated === false && $ configuration -> hasVersionMigrated ( $ version ) === true ) { $ version -> markNotMigrated ( ) ; } } } else { if ( $ configuration -> hasVersion ( $ version ) === false ) { throw MigrationException :: unknownMigrationVersion ( $ version ) ; } $ version = $ configuration -> getVersion ( $ version ) ; if ( $ markAsMigrated === true ) { if ( $ configuration -> hasVersionMigrated ( $ version ) === true ) { throw new MigrationException ( sprintf ( 'The version "%s" is already marked as executed.' , $ version ) ) ; } $ version -> markMigrated ( ) ; } else { if ( $ configuration -> hasVersionMigrated ( $ version ) === false ) { throw new MigrationException ( sprintf ( 'The version "%s" is already marked as not executed.' , $ version ) ) ; } $ version -> markNotMigrated ( ) ; } } }
Add a migration version to the migrations table or remove it.

This does not execute any migration code but simply records a version
as migrated or not.

@param string $version The version to add or remove
@param boolean $markAsMigrated
@return void
@throws MigrationException
@throws \LogicException
@throws DBALException
Add a migration version to the migrations table or remove it .