背景
裝了某個第三方包之后凤类,Laravel 使用 php artisan krlove:generate:model
生成 model 失敗宪塔,原因是第三方包中的某個表用了 enum
字段。然后就過不去了.. 吐槽下這個程序有點傻惕稻,你只生成我指定的表不就沒事了崎弃,全部掃描干什么
Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it
解決方案(暴力)
在 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
$this->doctrineTypeMapping = [
....
'enum' => 'string',// 加這個
];