<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('_road_tollhouse_management_histories', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('project_id')->nullable()->index('road_tollhouse_management_histories_project_id_foreign');
            $table->unsignedInteger('user_id')->nullable()->index('road_tollhouse_management_histories_user_id_foreign');
            $table->string('previous_axis_name')->nullable();
            $table->unsignedTinyInteger('previous_axis_type')->nullable();
            $table->string('previous_project_name')->nullable();
            $table->longText('previous_cities_id')->nullable();
            $table->string('previous_contractor_name')->nullable();
            $table->string('previous_consultant_name')->nullable();
            $table->string('previous_contract_date')->nullable();
            $table->string('previous_contract_credit')->nullable();
            $table->string('previous_start_latlng')->nullable();
            $table->string('previous_end_latlng')->nullable();
            $table->string('previous_team_latlng')->nullable();
            $table->string('previous_stop_reason')->nullable();
            $table->timestamp('previous_submited_at')->nullable();
            $table->timestamp('previous_last_updated_at')->nullable();
            $table->longText('previous_project_distance')->nullable();
            $table->longText('previous_project_distance_update')->nullable();
            $table->string('previous_contractor_credit')->nullable();
            $table->string('previous_physical_progress')->nullable();
            $table->text('previous_description')->nullable();
            $table->boolean('previous_status')->default(false);
            $table->boolean('previous_project_status')->default(false);
            $table->text('new_files')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('_road_tollhouse_management_histories');
    }
};
