<?php

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

return new class extends Migration
{
    public function up(): void
    {
        if (!DB::table('transaction_types')->where('id', 7)->exists()) {
            DB::table('transaction_types')->insert([
                'id'         => 7,
                'name'       => 'Rounding correction',
                'label'      => 'Rounding correction: corrects balance drift from decimal-to-time format conversion',
                'icon'       => 'wrench',
                'created_at' => null,
                'updated_at' => null,
            ]);
        }
    }

    public function down(): void
    {
        DB::table('transaction_types')->where('id', 7)->delete();
    }
};
