<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('mrf', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('company_id')->index();
            $table->integer('nature_of_request');
            $table->integer('classification')->nullable();
            $table->integer('job_title')->nullable();
            $table->string('document_type', 50)->nullable();
            $table->integer('salary_grade')->nullable();
            $table->integer('replacement_position_number')->nullable();
            $table->string('employee_name_to_be_replaced1', 50)->nullable();
            $table->string('nature_of_seperation1', 50)->nullable();
            $table->date('date_of_seperation1')->nullable();
            $table->integer('new_position_number')->nullable();
            $table->date('date_needed')->nullable();
            $table->string('employment_status', 50)->nullable();
            $table->string('supporting_document', 150)->nullable();
            $table->string('working_position_title', 150)->nullable();
            $table->string('inclusive_period', 50)->nullable();
            $table->string('attachment', 150)->nullable();
            $table->text('justification')->nullable();
            $table->string('salary', 100)->nullable();
            $table->text('job_design')->nullable();
            $table->text('deny_reason')->nullable();
            $table->string('requested_by', 50)->nullable()->index();
            $table->string('recommended_by', 50)->nullable()->index();
            $table->string('endorsed_by', 50)->nullable()->index();
            $table->string('approved_by', 50)->nullable()->index();
            $table->datetime('recommended_at')->nullable();
            $table->datetime('endorsed_at')->nullable();
            $table->datetime('approved_at')->nullable();
            $table->tinyInteger('status')->default(0);
            $table->boolean('enabled')->default(true);
            $table->softDeletes();
            $table->timestamps();
        }); 
    }

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