<?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('clearances', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('employee_id')->index();
            $table->string('clearance_template_id')->index();
            $table->string('shared_services')->nullable();
            $table->string('reason_id')->index();
            $table->date('date_accepted');
            $table->string('to_company')->index()->nullable();
            $table->date('effectivity_date');
            $table->date('from_date');
            $table->date('to_date');
            $table->longText('note');
            $table->boolean('enabled')->default(true)->index();
            $table->softDeletes();
            $table->timestamps();
        });
    }

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