<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddLocationToDriversTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('drivers', function (Blueprint $table) {
            // Adding location column as nullable longText
            $table->longText('location')->nullable();

            // Adding longitude and latitude columns as nullable decimals
            $table->longText('longitude')->nullable();
            $table->longText('latitude')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('drivers', function (Blueprint $table) {
            // Dropping the columns if rolling back migration
            $table->dropColumn('location');
            $table->dropColumn('longitude');
            $table->dropColumn('latitude');
        });
    }
}
