jonnybarnes.uk/database/migrations/2020_10_10_191546_add_latitude-longitude_columns.php

34 lines
752 B
PHP

<?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');
});
}
}