<?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('processed_absences', function (Blueprint $table) {
            $table->decimal('no_of_hours', 9,3)->default(0)->after('no_of_days');
            $table->decimal('no_of_days', 6,3)->change();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('processed_absences', function (Blueprint $table) {
            $table->dropColumn('no_of_hours');
            $table->decimal('no_of_days', 5,2)->change();
        });
    }
};
