我正在使用 Laravel 4.2
。我的 composer.json
"doctrine/dbal": "2.4.*",
我创建了以下迁移:
class RenameDeliveryNotesColumnOnOrderHeaderTable extends Migration {
public function up()
{
Schema::table('order_header', function(Blueprint $table)
{
$table->renameColumn('delivery_notes', 'packing_notes');
});
}
}
其中 delivery_notes
列类型为 text
。
当我运行迁移时,我收到以下错误:
[Doctrine\DBAL\DBALException] Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.
知道为什么我会收到此错误吗?我应该如何解决这个问题?我需要重命名表中的列。有没有其他方法可以重命名列?
最佳答案
DB::getDoctrineSchemaManager()
->getDatabasePlatform()
->registerDoctrineTypeMapping('enum', 'string');
这适用于 Laravel 5.1
关于php - Laravel db 迁移 - renameColumn 错误 - 请求了未知的数据库类型枚举,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29165259/