我使用的是Laravel 5.3,迁移对于控制数据库开发来说非常棒.
我的问题是当我将列类型从字符串更改为文本时,一切都运行良好.但是在用户保存长度超过255(varchar)的数据之后.然后我的迁移无法回滚.它会说数据太长了我的专栏.想问大家如何解决这个问题?
================================================== =======
Schema::table('tbname', function(Blueprint $table)
{
$table->text('value')->change();
});
Schema::table('tbname', function(Blueprint $table)
{
$table->string('value')->change();
});
Run Code Online (Sandbox Code Playgroud)
================================================== =======
播种机:
$records = [
[
'description' => 'The description is longer than 255. The description is longer than 255. The description is longer than 255. The description is longer than 255. The description is longer than 255. The description is longer than 255. The description is longer than 255. The description is longer than 255. The description is longer than 255. …Run Code Online (Sandbox Code Playgroud)