I'm using Laravel and I just added a new migration for increasing column size.
The first generated table has a column named latlong
of type Point
.
I can't modify any column size?
When I try to modify a column's size, I get the error below:
[Doctrine\DBAL\DBALException]
Unknown database type point requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.
Here are my migration files. First migration is for create a table abc
public function up()
{
Schema::create('abc', function (Blueprint $table) {
$table->increments('id');
$table->string('first_name', 20);
$table->string('last_name', 20);
$table->string('street', 100);
$table->string('city', 50)->nullable();
$table->string('state', 50)->nullable();
$table->string('postal_code', 15);
$table->string('mobile', 10)->nullable();
$table->timestamps();
$table->softDeletes();
});
Illuminate\Support\Facades\DB::statement('ALTER TABLE abc ADD latlong POINT');
}
Second migration is for update column size
public function up()
{
Schema::table('abc', function (Blueprint $table){
$table->string('mobile', 20)->nullable()->change();
});
}
Can anyone please help me with this?
Point
is not supported by laravel check this answer to fix this issue – GrubbsPoint
is the issue here. – BookcraftIlluminate\Support\Facades\DB::statement('ALTER TABLE abc MODIFY mobile VARCHAR(20)');
then it's working fine for me. But I don't want to use this solution. – Bookcraft