<?php

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

class CreateRahdariPointHistoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rahdari_point_histories', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedSmallInteger('point_id');
            $table->foreign('point_id')
                ->references('id')
                ->on('rahdari_points');
            $table->unsignedInteger('user_id');
            $table->foreign('user_id')
                ->references('id')
                ->on('users');
            $table->string('previous_status')->nullable();
            $table->string('previous_type')->nullable();
            $table->string('previous_team_num')->nullable();
            $table->string('previous_staff_num')->nullable();
            $table->string('previous_phone')->nullable();
            $table->string('previous_responsible_name')->nullable();
            $table->string('previous_responsible_mobile')->nullable();
            $table->string('previous_successor_name')->nullable();
            $table->string('previous_successor_mobile')->nullable();
            $table->string('previous_machines_light')->nullable();
            $table->string('previous_machines_sheavy')->nullable();
            $table->string('previous_machines_heavy')->nullable();
            $table->string('previous_lat')->nullable();
            $table->string('previous_lng')->nullable();
            $table->text('new_files')->nullable();
            $table->timestamps();
        });
    }

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