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()
                        );
                    }
                }
            }
        }
    }