【发布时间】:2020-05-27 07:40:31
【问题描述】:
我有大约 30 多个迁移文件。
当它进入包含列重命名的迁移时:
Schema::table('table', function (Blueprint $table) {
$table->renameColumn('old_field', 'new_field');
});
只有在进行此迁移时才会出错(比如第 15 次)。它运行所有其他迁移就好了。如果我将其注释掉,那么它将按预期完成。
我运行php artisan migrate 或php artisan migrate:fresh
我收到以下错误:
ErrorException : The "name" column option is not supported, setting it is deprecated and will cause an error in Doctrine 3.0
at /Volumes/Workspace/new-app-backend/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php:85
81| @trigger_error(sprintf(
82| 'The "%s" column option is not supported,' .
83| ' setting it is deprecated and will cause an error in Doctrine 3.0',
84| $name
> 85| ), E_USER_DEPRECATED);
86|
87| continue;
88| }
89| $this->$method($value);
Exception trace:
1 trigger_error("The "name" column option is not supported, setting it is deprecated and will cause an error in Doctrine 3.0")
/Volumes/Workspace/new-app-backend/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php:85
2 Doctrine\DBAL\Schema\Column::setOptions()
/Volumes/Workspace/new-app-backend/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php:67
php -v 给了我这个:
PHP 7.3.14 (cli) (built: Jan 24 2020 03:04:31) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.14, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.9.2, Copyright (c) 2002-2020, by Derick Rethans
with Zend OPcache v7.3.14, Copyright (c) 1999-2018, by Zend Technologies
Mysql -v 给了我这个:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 323
Server version: 5.7.29 Homebrew
我正在使用 "doctrine/dbal": "~2.3"
此错误仅在我的本地计算机上运行迁移时发生。在我的 docker-compose 堆栈和 Vagrant 框中按预期完成。所有版本都是相同的。为什么这只会发生在我的 Mac 上?
【问题讨论】:
-
从 ini 中删除了 xdebug.scream = 1,现在又可以工作了。