Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

petritr's avatar
Level 15

Unknown database type enum requested

I just rename an database column to enum then run the migration again and i got this error

   Doctrine\DBAL\DBALException  : Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.

  at /var/www/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php:479
    475|
    476|         $dbType = strtolower($dbType);
    477|
    478|         if (!isset($this->doctrineTypeMapping[$dbType])) {
  > 479|             throw new \Doctrine\DBAL\DBALException("Unknown database type ".$dbType." requested, " . get_class($this) . " may not support it.");
    480|         }
    481|
    482|         return $this->doctrineTypeMapping[$dbType];
    483|     }

  Exception trace:

The migration looks like:

            $table->renameColumn('address','region_id')->change();
            $table->enum('region_id', ['EU', 'USA']);

What im doing wrong now ?

0 likes
5 replies
D9705996's avatar

From the documentation

Renaming any column in a table that also has a column of type enum is not currently supported.

Therefore you region_id is causing the problem

https://laravel.com/docs/5.7/migrations#modifying-columns

You could try using a DB::Statement

DB::statement("ALTER TABLE table_name CHANGE `address` `region_id`");
1 like
petritr's avatar
Level 15

@D9705996 got it work at the end i don't know that chaining enum was not supported. Just deleted the column from db then run migration.

1 like
petritr's avatar
Level 15

@D9705996 witch is the best way to get the enum values from database ? I need to show the enum values in select option in the create method. Any ideas best practices ?

petritr's avatar
Level 15

Row db query worked for me, thanks for the reply though.

Please or to participate in this conversation.