久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Laravel 5.1 請求的未知數據庫類型枚舉

Laravel 5.1 Unknown database type enum requested(Laravel 5.1 請求的未知數據庫類型枚舉)
本文介紹了Laravel 5.1 請求的未知數據庫類型枚舉的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

在運行 php artisan migrate 時,出現以下錯誤

While running php artisan migrate, I got the following error

[DoctrineDBALDBALException]
請求的數據庫類型未知,DoctrineDBALPlatformsMySqlPlatform 可能不支持.

[DoctrineDBALDBALException]
Unknown database type enum requested, DoctrineDBALPlatformsMySqlPlatform may not support it.

如何解決這個問題.

代碼:

public function up() {
    Schema::table('blogs', function (Blueprint $table) {
        $table->string('wordpress_id')->nullable();
        $table->string('google_blog_id')->nullable()->change();
    });
}

推薦答案

官方 Laravel 5.1 文檔指出:

The official Laravel 5.1 documentation states:

注意:當前不支持使用枚舉列重命名表中的列.

Note: Renaming columns in a table with a enum column is not currently supported.

如果您嘗試更改另一列并不重要,如果表包含 enum 任何地方,它都將不起作用.這是 Doctrine DBAL 問題.

It doesn't matter if you're trying to change another column, if the table contains a enum anywhere it won't work. It's a Doctrine DBAL issue.

作為一種解決方法,您可以刪除該列并添加一個新列(列數據將丟失):

As a workaround you could either drop the column and add a new one (column data will be lost):

public function up()
{
    Schema::table('users', function(Blueprint $table)
    {
        $table->dropColumn('name');
    });

    Schema::table('users', function(Blueprint $table)
    {
        $table->text('username');
    });
}

或使用 DB 語句:

public function up()
{
    DB::statement('ALTER TABLE projects CHANGE slug url VARCHAR(200)');
}

public function down()
{
    DB::statement('ALTER TABLE projects CHANGE url slug VARCHAR(200)');
}

來源:https://github.com/laravel/framework/issues/1186

這篇關于Laravel 5.1 請求的未知數據庫類型枚舉的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Laravel Eloquent Union query(Laravel Eloquent Union 查詢)
Overwrite laravel 5 helper function(覆蓋 Laravel 5 輔助函數)
laravel querybuilder how to use like in wherein function(laravel querybuilder 如何在 where 函數中使用 like)
The Response content must be a string or object implementing __toString(), quot;booleanquot; given after move to psql(響應內容必須是實現 __toString()、“boolean和“boolean的字符串或對象.移動到 psql 后給出) - IT屋-程
Roles with laravel 5, how to allow only admin access to some root(Laravel 5 的角色,如何只允許管理員訪問某些根)
Laravel Auth - use md5 instead of the integrated Hash::make()(Laravel Auth - 使用 md5 而不是集成的 Hash::make())
主站蜘蛛池模板: 欧美啪啪网 | 久久91| 成人在线a | 国产免费一级片 | www.youjizz.com日本| 久久免费精品视频 | 亚洲成av| 一级片在线视频 | 亚洲激情视频在线观看 | 欧美一级全黄 | 亚洲天堂久久久 | 国产黄色在线 | 日韩精品一区二区在线 | 国产日韩精品视频 | 91久久综合亚洲鲁鲁五月天 | 久操不卡 | 福利片在线 | 欧美精品久久99 | 国产美女永久免费无遮挡 | 黄色片网站视频 | 国产一及片 | 在线观看三级 | 蜜桃精品一区二区三区 | 一级片免费播放 | 99福利视频 | 黄色高清网站 | 国产精品原创 | 久久xxx| xxxx黄色| 亚洲一区二区在线视频 | 国产二区三区 | 国产一级片免费看 | av超碰在线 | 欧美一级欧美三级 | 一级性生活视频 | 日韩欧美亚洲国产 | 久久国产一区 | 91性高潮久久久久久久久 | 亚洲免费二区 | 我想看毛片 | 天天插夜夜操 |