Php 已请求Laravel迁移uknown数据库枚举

Php 已请求Laravel迁移uknown数据库枚举,php,laravel,laravel-migrations,Php,Laravel,Laravel Migrations,现场应用程序有订单表 Schema::create('order', function($table){ $table->increments('id'); $table->integer('user_id')->unsigned(); $table->dateTime('date')->nullable(); $table->enum('status', array('CREATED

现场应用程序有订单表

    Schema::create('order', function($table){

        $table->increments('id');
        $table->integer('user_id')->unsigned();
        $table->dateTime('date')->nullable();

        $table->enum('status', array('CREATED','FINISHED'))->default('CREATED');
    });
    Schema::table('order', function($table){
        $table->enum('status', array('CREATED','FINISHED','CLOSED'))->default('CREATED')->change();
    });
现在我需要更新该表中的status字段,但我想将旧数据保存在数据库中。所以我又创建了一个迁移,它将更新订单表中的状态字段

    Schema::create('order', function($table){

        $table->increments('id');
        $table->integer('user_id')->unsigned();
        $table->dateTime('date')->nullable();

        $table->enum('status', array('CREATED','FINISHED'))->default('CREATED');
    });
    Schema::table('order', function($table){
        $table->enum('status', array('CREATED','FINISHED','CLOSED'))->default('CREATED')->change();
    });

但是当我运行
php artisan migrate
时,我得到一个错误,说
请求了未知的数据库类型enum,Doctrine\DBal\Platforms\MySqlPlatform可能不支持它。
我建议您使用查询生成器的facade来实现同样的功能

DB::statement("ALTER TABLE order CHANGE COLUMN status status  
ENUM('CREATED', 'FINISHED', 'CLOSED') NOT NULL DEFAULT 'CREATED'");
通过原始迁移是不可能的

注意:-只有以下列类型可以“更改”:bigInteger、binary、boolean、date、dateTime、dateTimeTz、decimal、, 整数、json、longText、mediumText、smallInteger、字符串、文本、时间、, unsignedBigInteger、unsignedInteger和unsignedSmallInteger

从:“只能“更改”以下列类型:biginger、binary、boolean、date、dateTime、dateTimeTz、decimal、integer、json、longText、mediumText、smallInteger、string、text、time、unsignedbiginger、unsignedInteger和unsignedSmallInteger。”“当前不支持重命名表中同时包含enum类型列的任何列。可能存在重复的。”