private function alterField($schemaEditor, $fromState, $toState)
    {
        $toModel = $toState->getRegistry()->getModel($this->modelName);
        if ($this->allowMigrateModel($schemaEditor->connection, $toModel)) {
            $fromModel = $fromState->getRegistry()->getModel($this->modelName);
            $fromField = $fromModel->getMeta()->getField($this->name);
            $toField = $toModel->getMeta()->getField($this->name);
            if (false === $this->preserveDefault) {
                $toField->default = $this->field->default;
            }
            $schemaEditor->alterField($fromModel, $fromField, $toField);

            if (false === $this->preserveDefault) {
                $toField->default = NOT_PROVIDED;
            }
        }
    }
private function alterField($schemaEditor, $fromState, $toState)
    {
        $toModel = $toState->getRegistry()->getModel($this->modelName);
        if ($this->allowMigrateModel($schemaEditor->connection, $toModel)) {
            $fromModel = $fromState->getRegistry()->getModel($this->modelName);
            $fromField = $fromModel->getMeta()->getField($this->name);
            $toField = $toModel->getMeta()->getField($this->name);
            if (false === $this->preserveDefault) {
                $toField->default = $this->field->default;
            }
            $schemaEditor->alterField($fromModel, $fromField, $toField);

            if (false === $this->preserveDefault) {
                $toField->default = NOT_PROVIDED;
            }
        }
    }
private function alterField ( $ schemaEditor , $ fromState , $ toState ) { $ toModel = $ toState -> getRegistry ( ) -> getModel ( $ this -> modelName ) ; if ( $ this -> allowMigrateModel ( $ schemaEditor -> connection , $ toModel ) ) { $ fromModel = $ fromState -> getRegistry ( ) -> getModel ( $ this -> modelName ) ; $ fromField = $ fromModel -> getMeta ( ) -> getField ( $ this -> name ) ; $ toField = $ toModel -> getMeta ( ) -> getField ( $ this -> name ) ; if ( false === $ this -> preserveDefault ) { $ toField -> default = $ this -> field -> default ; } $ schemaEditor -> alterField ( $ fromModel , $ fromField , $ toField ) ; if ( false === $ this -> preserveDefault ) { $ toField -> default = NOT_PROVIDED ; } } }
Does the actual field alteration.

@param SchemaEditor $schemaEditor
@param ProjectState $fromState
@param ProjectState $toState

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>

@throws \Eddmash\PowerOrm\Exception\LookupError
@throws \Eddmash\PowerOrm\Exception\FieldDoesNotExist
@throws \Eddmash\PowerOrm\Exception\ValueError
@throws \Eddmash\PowerOrm\Exception\AppRegistryNotReady
Does the actual field alteration .