我正在嘗試將我的用戶表中的字段更改爲200的varchar。目前它是60並且不夠長。我嘗試使用 - >更改(),但因爲表有一個枚舉我得到一個錯誤Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.
因此,我試圖改變列使用原始的sql語句。 這是我正在嘗試使用的行。laravel中的SQL錯誤
DB::statement('ALTER TABLE users CHANGE COLUMN subrole VARCHAR(200)');
當我嘗試這個,我得到一個錯誤
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near 'VARCHAR(200)' at line 1 (SQL: ALTER TABLE users CHANGE COLUMN subrole VARCHAR(200))
我需要做什麼改變嗎?我試圖改變子角色的大小VARCHAR列200