<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('maklumat_buku_darjah', function (Blueprint $table) {
            $table->unsignedInteger('stok_hingga_akhir')->default(0)->after('anggaran_buku_elok_tangan');
            $table->unsignedInteger('elok_hingga_akhir')->default(0)->after('stok_hingga_akhir');
            $table->unsignedInteger('pesan_tahun')->default(0)->after('elok_hingga_akhir');
        });
    }

    public function down(): void
    {
        Schema::table('maklumat_buku_darjah', function (Blueprint $table) {
            $table->dropColumn(['stok_hingga_akhir', 'elok_hingga_akhir', 'pesan_tahun']);
        });
    }
};
