private function alterModelTable($schemaEditor, $fromState, $toState)
    {
        $toModel = $toState->getRegistry()->getModel($this->name);

        if ($this->allowMigrateModel($schemaEditor->connection, $toModel)) {
            $fromModel = $fromState->getRegistry()->getModel($this->name);
            $schemaEditor->alterDbTable(
                $toModel,
                $fromModel->getMeta()->getDbTable(),
                $toModel->getMeta()->getDbTable()
            );

            // Rename M2M fields whose name is based on this model's db_table

            /** @var $newField ManyToManyField */
            /* @var $oldField ManyToManyField */
            foreach ($toModel->getMeta()->localManyToMany as $newName => $newField) {
                foreach ($fromModel->getMeta()->localManyToMany as $oldName => $oldField) {
                    if ($newName === $oldName) {
                        $schemaEditor->alterDbTable(
                            $newField->relation->through,
                            $oldField->relation->through->getMeta()->getDbTable(),
                            $newField->relation->through->getMeta()->getDbTable()
                        );
                    }
                }
            }
        }
    }
private function alterModelTable($schemaEditor, $fromState, $toState)
    {
        $toModel = $toState->getRegistry()->getModel($this->name);

        if ($this->allowMigrateModel($schemaEditor->connection, $toModel)) {
            $fromModel = $fromState->getRegistry()->getModel($this->name);
            $schemaEditor->alterDbTable(
                $toModel,
                $fromModel->getMeta()->getDbTable(),
                $toModel->getMeta()->getDbTable()
            );

            // Rename M2M fields whose name is based on this model's db_table

            /** @var $newField ManyToManyField */
            /* @var $oldField ManyToManyField */
            foreach ($toModel->getMeta()->localManyToMany as $newName => $newField) {
                foreach ($fromModel->getMeta()->localManyToMany as $oldName => $oldField) {
                    if ($newName === $oldName) {
                        $schemaEditor->alterDbTable(
                            $newField->relation->through,
                            $oldField->relation->through->getMeta()->getDbTable(),
                            $newField->relation->through->getMeta()->getDbTable()
                        );
                    }
                }
            }
        }
    }
private function alterModelTable ( $ schemaEditor , $ fromState , $ toState ) { $ toModel = $ toState -> getRegistry ( ) -> getModel ( $ this -> name ) ; if ( $ this -> allowMigrateModel ( $ schemaEditor -> connection , $ toModel ) ) { $ fromModel = $ fromState -> getRegistry ( ) -> getModel ( $ this -> name ) ; $ schemaEditor -> alterDbTable ( $ toModel , $ fromModel -> getMeta ( ) -> getDbTable ( ) , $ toModel -> getMeta ( ) -> getDbTable ( ) ) ; // Rename M2M fields whose name is based on this model's db_table /** @var $newField ManyToManyField */ /* @var $oldField ManyToManyField */ foreach ( $ toModel -> getMeta ( ) -> localManyToMany as $ newName => $ newField ) { foreach ( $ fromModel -> getMeta ( ) -> localManyToMany as $ oldName => $ oldField ) { if ( $ newName === $ oldName ) { $ schemaEditor -> alterDbTable ( $ newField -> relation -> through , $ oldField -> relation -> through -> getMeta ( ) -> getDbTable ( ) , $ newField -> relation -> through -> getMeta ( ) -> getDbTable ( ) ) ; } } } } }
Does the actual alteration of the model table.

@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
Does the actual alteration of the model table .