<?php

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

class UpdateRoadMaintenanceProjectsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('road_maintenance_projects', function (Blueprint $table) {
            //$table->string('consultant_name')->nullable()->after('contractor_name');
            $table->json('project_distance_update')->nullable()->after('project_distance');
        });

        Schema::table('road_maintenance_project_histories', function (Blueprint $table) {
            $table->json('previous_project_distance_update')->nullable()->after('previous_project_distance');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('road_maintenance_projects', function (Blueprint $table) {
            $table->dropColumn('consultant_name');
        });
    }
}
