I am using Laravel 5.3, and the migration is really awesome to control db development.
My question is when I change the column type from string to text, everything is working well. But after user save data which length longer than 255(varchar). Then my migrate can't rollback. It will say Data too long for my column. Would like to ask everyone how to solve this problem?
=========================================================
Schema::table('tbname', function(Blueprint $table)
{
$table->text('value')->change();
});
Schema::table('tbname', function(Blueprint $table)
{
$table->string('value')->change();
});
=========================================================
Seeder:
$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. The description is longer than 255. The description is longer than 255. '
],
[
'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. The description is longer than 255. The description is longer than 255. '
]
];
foreach ($records as $index => $record) {
Desc::create($record);
}