protected function migrate($upVersion, $increment, $force)
    {
        $versionInfo = $this->getCurrentVersion();
        $currentVersion = intval($versionInfo['version']) + $increment;

        if (strpos($versionInfo['status'], Migration::VERSION_STATUS_PARTIAL) !== false && !$force) {
            throw new DatabaseIsIncompleteException('Database was not fully updated. Use --force for migrate.');
        }

        while ($this->canContinue($currentVersion, $upVersion, $increment)
            && file_exists($file = $this->getMigrationSql($currentVersion, $increment))
        ) {
            if ($this->callableProgress) {
                call_user_func_array($this->callableProgress, ['migrate', $currentVersion]);
            }

            $this->getDbCommand()->setVersion($currentVersion, Migration::VERSION_STATUS_PARTIAL . ' ' . ($increment>0 ? 'up' : 'down'));
            $this->getDbCommand()->executeSql(file_get_contents($file));
            $this->getDbCommand()->setVersion($currentVersion, Migration::VERSION_STATUS_COMPLETE);
            $currentVersion = $currentVersion + $increment;
        }
    }
protected function migrate($upVersion, $increment, $force)
    {
        $versionInfo = $this->getCurrentVersion();
        $currentVersion = intval($versionInfo['version']) + $increment;

        if (strpos($versionInfo['status'], Migration::VERSION_STATUS_PARTIAL) !== false && !$force) {
            throw new DatabaseIsIncompleteException('Database was not fully updated. Use --force for migrate.');
        }

        while ($this->canContinue($currentVersion, $upVersion, $increment)
            && file_exists($file = $this->getMigrationSql($currentVersion, $increment))
        ) {
            if ($this->callableProgress) {
                call_user_func_array($this->callableProgress, ['migrate', $currentVersion]);
            }

            $this->getDbCommand()->setVersion($currentVersion, Migration::VERSION_STATUS_PARTIAL . ' ' . ($increment>0 ? 'up' : 'down'));
            $this->getDbCommand()->executeSql(file_get_contents($file));
            $this->getDbCommand()->setVersion($currentVersion, Migration::VERSION_STATUS_COMPLETE);
            $currentVersion = $currentVersion + $increment;
        }
    }
protected function migrate ( $ upVersion , $ increment , $ force ) { $ versionInfo = $ this -> getCurrentVersion ( ) ; $ currentVersion = intval ( $ versionInfo [ 'version' ] ) + $ increment ; if ( strpos ( $ versionInfo [ 'status' ] , Migration :: VERSION_STATUS_PARTIAL ) !== false && ! $ force ) { throw new DatabaseIsIncompleteException ( 'Database was not fully updated. Use --force for migrate.' ) ; } while ( $ this -> canContinue ( $ currentVersion , $ upVersion , $ increment ) && file_exists ( $ file = $ this -> getMigrationSql ( $ currentVersion , $ increment ) ) ) { if ( $ this -> callableProgress ) { call_user_func_array ( $ this -> callableProgress , [ 'migrate' , $ currentVersion ] ) ; } $ this -> getDbCommand ( ) -> setVersion ( $ currentVersion , Migration :: VERSION_STATUS_PARTIAL . ' ' . ( $ increment > 0 ? 'up' : 'down' ) ) ; $ this -> getDbCommand ( ) -> executeSql ( file_get_contents ( $ file ) ) ; $ this -> getDbCommand ( ) -> setVersion ( $ currentVersion , Migration :: VERSION_STATUS_COMPLETE ) ; $ currentVersion = $ currentVersion + $ increment ; } }
Method for execute the migration.

@param int $upVersion
@param int $increment Can accept 1 for UP or -1 for down
@param bool $force
@throws \ByJG\DbMigration\Exception\DatabaseDoesNotRegistered
@throws \ByJG\DbMigration\Exception\DatabaseIsIncompleteException
@throws \ByJG\DbMigration\Exception\DatabaseNotVersionedException
@throws \ByJG\DbMigration\Exception\InvalidMigrationFile
@throws \ByJG\DbMigration\Exception\OldVersionSchemaException
Method for execute the migration .