<?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::table('clearances', function (Blueprint $table) {
            $table->integer('company_id')->after('employee_id')->index();
            $table->datetime('hr_approval')->after('to_date')->nullable();
            $table->datetime('endorsement_date')->after('hr_approval')->nullable();
            $table->string('created_by')->after('enabled');
            $table->datetime('check_prepared')->after('created_by')->nullable();
            $table->datetime('release_date')->after('check_prepared')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('clearances', function (Blueprint $table) {
            $table->dropColumn('created_by');
            $table->dropColumn('check_prepared');
            $table->dropColumn('release_date');
        });
    }
};
