change float to float with more precision in laravel 5.1

I have a database with two floats for latitude and longitude, but I see that they get cut off after two positions precision. Laravel seems to create DOUBLE(8,2) when migrating a float.

What I tried is change the float and add the number of positions to it, like so:

$table->float('latitude', 10, 8)->change();

That doesn’t seem to do anything in laravel 5.1, the precision stays at only 2 positions. I tried the following as well:

$table->double('latitude', 10, 8)->change();

But that causes a crash on DoctrineDBAL Unknown column type "double" requested.

Any ideas how I can change my existing columns for lat and lng into a more precies number with 8 positions precision?

Source: mysql

Leave a Reply