Latheesan Latheesan - 3 months ago 85
PHP Question

Laravel db migration - renameColumn error - Unknown database type enum requested

I am using Laravel

. I have the following library loaded in my

"doctrine/dbal": "2.4.*",

I created the following migration:

class RenameDeliveryNotesColumnOnOrderHeaderTable extends Migration {

public function up()
Schema::table('order_header', function(Blueprint $table)
$table->renameColumn('delivery_notes', 'packing_notes');


column type is

When I run the migration, I get the following error:

[Doctrine\DBAL\DBALException] Unknown database type enum requested,
Doctrine\DBAL\Platforms\MySqlPlatform may not support it.

Any idea why I am getting this error? How should I go about fixing this? I need to rename a column in my table. Are there any alternative way to rename the column?


I googled your issue a bit and I found out that it's a known issue.

Laravel's docs ( say that

Note: Renaming enum column types is not supported.


You can find some workarounds about this issue. And since you said that this column is not enum, take a look at @upngo's comment:

"...The issue is renaming ANY column on a table that has an enum."

Also I found this article that focuses on this issue and suggest an option that might help you.