<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        $now = Carbon::now();

        DB::table('accounting_settings')->insert([
            [
                'setting_key' => 'btkl_dibebankan',
                'account_id'  => 51,
                'created_at'  => $now,
                'updated_at'  => $now,
            ],
            [
                'setting_key' => 'bop_dibebankan',
                'account_id'  => 52,
                'created_at'  => $now,
                'updated_at'  => $now,
            ]
        ]);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        // Menghapus data jika migrasi di-rollback
        DB::table('accounting_settings')
            ->whereIn('setting_key', ['btkl_dibebankan', 'bop_dibebankan'])
            ->delete();
    }
};