Laravel: String data, right truncated: 1406 Data too long for column

后端 未结 6 1577
予麋鹿
予麋鹿 2021-02-04 01:18

I have a table with a column \'hotel\'. The project is created in Laravel 5.4, so I used Migrations.

    $table->string(\'hotel\', 50);

Thi

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-04 01:58

    You need to create a new migration, register it with composer du command and run php artisan migrate command to change type of the column:

    Schema::table('the_table_name', function (Blueprint $table) {
        $table->string('hotel', 255)->change();
    });
    

提交回复
热议问题