<?php

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

class CreateJaheshOperationHistoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('jahesh_operation_histories', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedSmallInteger('jahesh_operation_id');
            $table->foreign('jahesh_operation_id')
                ->references('id')
                ->on('jahesh_operations');
            $table->unsignedInteger('user_id');
            $table->foreign('user_id')
                ->references('id')
                ->on('users');
            $table->string('previous_operation_1')->nullable();
            $table->string('previous_operation_2')->nullable();
            $table->string('previous_operation_3')->nullable();
            $table->string('previous_operation_4')->nullable();
            $table->string('previous_operation_5')->nullable();
            $table->string('previous_operation_6')->nullable();
            $table->string('previous_operation_7')->nullable();
            $table->string('previous_operation_8')->nullable();
            $table->string('previous_operation_9')->nullable();
            $table->string('previous_operation_10')->nullable();
            $table->string('previous_operation_11')->nullable();
            $table->string('previous_operation_12')->nullable();
            $table->timestamps();
        });
    }

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