当我运行时:
php artisan migrate
并希望将字符串字段修改为文本字段,如下所示:
//the old field that i want to modify in migration file
$table->string('description')->nullable();
//and the new text field
$table->text('description')->change();
我收到以下错误:
Unknown database type json requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.
最佳答案
试试这个解决方案可能对你有用,
public function __construct()
{
DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'text');
}
有关此问题的进一步阅读,请查看 Issue #15772在 Laravel 仓库
关于php - "Unknown database type json requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it."运行 php artisan migrate 命令时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48256476/