<?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('attendance_posting_details', function (Blueprint $table) {
            $table->decimal('hours_absent', 9,3)->default(0)->after('days_absent');
            $table->decimal('days_absent', 9,3)->change();
            $table->decimal('work_days', 9,3)->change();
            $table->decimal('work_hours', 9,3)->change();
            $table->decimal('actual_work_days', 9,3)->change();
            $table->decimal('leave_hours', 9,3)->change();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('attendance_posting_details', function (Blueprint $table) {
            $table->dropColumn('hours_absent');
            $table->decimal('days_absent', 5,2)->change();
            $table->decimal('work_days', 5,2)->change();
            $table->decimal('work_hours', 5,2)->change();
            $table->decimal('actual_work_days', 5,2)->change();
            $table->decimal('leave_hours', 5,2)->change();
            //
        });
    }
};
