When I run:
php artisan migrate
and want to modify a string field to a text field like this:
//the old field that i want to modify in migration file
$table->string('description')->nullable();
//and the new text field
$table->text('description')->change();
I get the following error:
Unknown database type json requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.
解决方案
try this solution may be this will work for you,
public function __construct()
{
DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'text');
}
For further reading about this issue check Issue #15772 at laravel repo