Allow postgis location data to be copied to float columns

This commit is contained in:
Jonny Barnes 2020-10-10 20:56:29 +01:00
parent fad7a4be0f
commit 0993d0187f
2 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddLatitudeLongitudeColumns extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('places', function (Blueprint $table) {
$table->float('latitude')->nullable();
$table->float('longitude')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('places', function (Blueprint $table) {
$table->dropColumn('latitude');
$table->dropColumn('longitude');
});
}
}