<?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('simbhpreport', function (Blueprint $table) {
            if (!Schema::hasColumn('simbhpreport', 'masa_expired')) {
                $table->date('masa_expired')->nullable()->after('satuan_transaksi');
            }
        });
    }

    public function down(): void
    {
        Schema::table('simbhpreport', function (Blueprint $table) {
            if (Schema::hasColumn('simbhpreport', 'masa_expired')) {
                $table->dropColumn('masa_expired');
            }
        });
    }
};
