<?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('employee_leaves', function (Blueprint $table) {
            $table->decimal('credits_from', 12, 2)->after('hours');
            $table->decimal('credits_to', 12, 2)->after('credits_from');
            $table->unsignedBigInteger("posting_id")->nullable()->after("posted")->index();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('employee_leaves', function (Blueprint $table) {
            $table->dropColumn('credits_from');
            $table->dropColumn('credits_to');
        });
    }
};
