Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug that rename column name failed when using doctrine/dbal. #3272

Merged
merged 6 commits into from
Feb 18, 2021
Merged

Fixed bug that rename column name failed when using doctrine/dbal. #3272

merged 6 commits into from
Feb 18, 2021

Conversation

canren
Copy link
Contributor

@canren canren commented Feb 18, 2021

Fixed renameColumn the name column option is not supported

@limingxinleo
Copy link
Member

简述一下这里是为了修改什么问题

@canren
Copy link
Contributor Author

canren commented Feb 18, 2021

通过 renameColumn 方法来重命名字段的时候

Schema::table('users', function (Blueprint $table) {
    // 将字段从 from 重命名为 to
    $table->renameColumn('from', 'to')->change();
});

PHP Fatal error: Uncaught Doctrine\DBAL\Schema\Exception\UnknownColumnOption: The "name" column option is not supported.

使用了 doctrine/dbal 组件,升级到 ^3.0 版本。

doctrine/dbal/src/Schema/Column.php:line84 抛异常了,method_exists 检查类的方法不存在,会导致程序中断

doctrine/dbal:^2.6 版本不会导致中断

@limingxinleo
Copy link
Member

我稍微改了下,你要不试试新的代码?

@limingxinleo limingxinleo changed the title Fixed renameColumn the name column option is not supported Fixed bug that rename column name failed when using doctrine/dbal. Feb 18, 2021
limingxinleo
limingxinleo previously approved these changes Feb 18, 2021
limingxinleo
limingxinleo previously approved these changes Feb 18, 2021
@limingxinleo limingxinleo merged commit 67769ad into hyperf:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants