src/Phinx/Migration/Manager.php
public function migrateToDateTime($environment, \DateTime $dateTime, $fake = false)
    {
        $versions = array_keys($this->getMigrations($environment));
        $dateString = $dateTime->format('YmdHis');

        $outstandingMigrations = array_filter($versions, function ($version) use ($dateString) {
            return $version <= $dateString;
        });

        if (count($outstandingMigrations) > 0) {
            $migration = max($outstandingMigrations);
            $this->getOutput()->writeln('Migrating to version ' . $migration);
            $this->migrate($environment, $migration, $fake);
        }
    }
public function migrateToDateTime($environment, \DateTime $dateTime, $fake = false)
    {
        $versions = array_keys($this->getMigrations($environment));
        $dateString = $dateTime->format('YmdHis');

        $outstandingMigrations = array_filter($versions, function ($version) use ($dateString) {
            return $version <= $dateString;
        });

        if (count($outstandingMigrations) > 0) {
            $migration = max($outstandingMigrations);
            $this->getOutput()->writeln('Migrating to version ' . $migration);
            $this->migrate($environment, $migration, $fake);
        }
    }
public function migrateToDateTime ( $ environment , \ DateTime $ dateTime , $ fake = false ) { $ versions = array_keys ( $ this -> getMigrations ( $ environment ) ) ; $ dateString = $ dateTime -> format ( 'YmdHis' ) ; $ outstandingMigrations = array_filter ( $ versions , function ( $ version ) use ( $ dateString ) { return $ version <= $ dateString ; } ) ; if ( count ( $ outstandingMigrations ) > 0 ) { $ migration = max ( $ outstandingMigrations ) ; $ this -> getOutput ( ) -> writeln ( 'Migrating to version ' . $ migration ) ; $ this -> migrate ( $ environment , $ migration , $ fake ) ; } }
Migrate to the version of the database on a given date.

@param string    $environment Environment
@param \DateTime $dateTime    Date to migrate to
@param bool      $fake        flag that if true, we just record running the migration, but not actually do the
migration

@return void
Migrate to the version of the database on a given date .