我用的是拉威尔4.2.我的composer.json中加载了以下库

"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');
        });
    }

}

其中,delivery_notes列类型是text.

运行迁移时,出现以下错误:

[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?

推荐答案

Laravel's documentation人说:

Note:不支持重命名enum列类型.

Here: https://github.com/laravel/framework/issues/1186

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."

另外,我发现这篇文章集中在这个问题上,并向您推荐了一个可能对您有帮助的选项.

http://www.paulbill.com/110/laravel-unknown-database-type-enum-requested-doctrinedbalplatformsmysqlplatform-may-not-support-it

Laravel相关问答推荐

Laravel复选框值更新

如何从@foreach 循环中捕获所有数据并将其传递给 值? - Laravel

Laravel 5.2 无法打开 laravel.log

在 laravel 的集合中找到?例子

磁盘 [视频] 没有配置的驱动程序

PHP Laravel:如何设置或获取会话数据?

在集合 laravel 中使用查询范围

file_put_content ...无法打开流:Laravel 5 中的权限被拒绝

localhost 和stream_socket_enable_crypto():SSL 操作失败,代码为 1

如何仅从 laravel FormRequest 中获取经过验证的数据?

无法打开流:没有这样的文件或目录(Laravel)

脚本 php artisan clear-compiled 处理 pre-update-cmd 事件返回错误(Laravel 4.1 升级)

将自定义消息(或任何其他数据)传递给 Laravel 404.blade.php

Laravel 中的单会话登录

调用未定义的方法 Illuminate\Routing\Route::get()

如何清理 Laravel Bootstrap 缓存配置文件?

Composer RuntimeException - 无法加载软件包 mews/purifier

如何从 PHPUnit 测试设置运行 Laravel 数据库 seeder 机?

Laravel如何仅响应没有正文消息的204代码状态

如何从 laravel 5.1 中数据库表的 created_at 属性中 Select 年份和月份?