<?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('pemilik_jaminan', function (Blueprint $table) {
            // nullable

            $table->unsignedBigInteger('mig_kd_debitur_seq')->nullable()->comment('asal data LPJ.PRM_DEBITUR.KD_DEBITUR_SEQ. Berguna untuk update debitur_id menggunakan KD_DEBITUR_SEQ nya');
            $table->timestamp('processed_at')->nullable();
            $table->char('is_mig', 1)->nullable()->comment('untuk menandakan row ini dari LPJ OLD');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('pemilik_jaminan', function (Blueprint $table) {


            // Hapus kolom tambahan yang dibuat di up()
            $table->dropColumn([
                'mig_kd_debitur_seq',
                'processed_at',
                'is_mig'
            ]);
        });
    }
};
