public function discardUpperMigrations(Bundle $bundle)
    {
        $drivers = array_keys($this->getAvailablePlatforms());
        $currentVersion = $this->migrator->getCurrentVersion($bundle);
        $this->log("Deleting migration classes above version {$currentVersion} for '{$bundle->getName()}'...");
        $hasDeleted = false;

        foreach ($drivers as $driver) {
            $deletedVersions = $this->writer->deleteUpperMigrationClasses($bundle, $driver, $currentVersion);

            if (count($deletedVersions) > 0) {
                $hasDeleted = true;

                foreach ($deletedVersions as $version) {
                    $this->log(" - Deleted {$version} for driver {$driver}");
                }
            }
        }

        if (!$hasDeleted) {
            $this->log('Nothing to discard: there are no migrations classes above the current version');
        }
    }
public function discardUpperMigrations(Bundle $bundle)
    {
        $drivers = array_keys($this->getAvailablePlatforms());
        $currentVersion = $this->migrator->getCurrentVersion($bundle);
        $this->log("Deleting migration classes above version {$currentVersion} for '{$bundle->getName()}'...");
        $hasDeleted = false;

        foreach ($drivers as $driver) {
            $deletedVersions = $this->writer->deleteUpperMigrationClasses($bundle, $driver, $currentVersion);

            if (count($deletedVersions) > 0) {
                $hasDeleted = true;

                foreach ($deletedVersions as $version) {
                    $this->log(" - Deleted {$version} for driver {$driver}");
                }
            }
        }

        if (!$hasDeleted) {
            $this->log('Nothing to discard: there are no migrations classes above the current version');
        }
    }
public function discardUpperMigrations ( Bundle $ bundle ) { $ drivers = array_keys ( $ this -> getAvailablePlatforms ( ) ) ; $ currentVersion = $ this -> migrator -> getCurrentVersion ( $ bundle ) ; $ this -> log ( "Deleting migration classes above version {$currentVersion} for '{$bundle->getName()}'..." ) ; $ hasDeleted = false ; foreach ( $ drivers as $ driver ) { $ deletedVersions = $ this -> writer -> deleteUpperMigrationClasses ( $ bundle , $ driver , $ currentVersion ) ; if ( count ( $ deletedVersions ) > 0 ) { $ hasDeleted = true ; foreach ( $ deletedVersions as $ version ) { $ this -> log ( " - Deleted {$version} for driver {$driver}" ) ; } } } if ( ! $ hasDeleted ) { $ this -> log ( 'Nothing to discard: there are no migrations classes above the current version' ) ; } }
Deletes migration classes which are above the current version of a bundle.

@param \Symfony\Component\HttpKernel\Bundle\Bundle $bundle
Deletes migration classes which are above the current version of a bundle .