# Laravel migrate Unknown database type enum 問題 下 migrate 的時候碰到以下問題, 這是 `Doctrine\DBAL` 的 issue, 是發生在要 change 欄位的時候, 不管是不是要改 enum 欄位 ```php= Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it. ``` # 解法 在 migration file 的 constructor 加 ``` use Illuminate\Support\Facades\DB; public function __construct() { DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); } ``` # 參考 https://stackoverflow.com/questions/33140860/laravel-5-1-unknown-database-type-enum-requested ###### tags: `2022` `laravel` `migrate` `troubleshooting` {%hackmd BJrTq20hE %}