<?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('cmms_forms_histories', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('cmms_form_id')->nullable()->index('cmms_forms_histories_cmms_form_id_foreign');
            $table->unsignedBigInteger('user_id');
            $table->string('previous_chassis_number')->nullable();
            $table->string('previous_province_id')->nullable();
            $table->string('previous_province_fa')->nullable();
            $table->string('previous_city_id')->nullable();
            $table->string('previous_city_fa')->nullable();
            $table->string('previous_device_name')->nullable();
            $table->string('previous_operator_name')->nullable();
            $table->string('previous_operator_nationalcode')->nullable();
            $table->string('previous_operator_phone')->nullable();
            $table->string('previous_gps_code')->nullable();
            $table->timestamps();
            $table->text('previous_image1')->nullable();
            $table->text('previous_image2')->nullable();
            $table->text('previous_image3')->nullable();
            $table->text('previous_file1')->nullable();
            $table->string('previous_form_number')->nullable();
        });
    }

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