Laravel migrations change a column type from varchar to longText

前端 未结 5 1952
野性不改
野性不改 2021-02-02 06:49

I need to change with migration column type of $table->string(\'text\'); to a text type, I have tried to do that in few ways, but none of them worked. Is it poss

5条回答
  •  长发绾君心
    2021-02-02 07:36

    According to Laravel Doc

    You can do it like

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

    be sure to add the doctrine/dbal dependency to your composer.json file

提交回复
热议问题