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

            $table->string('From_Bank_Acc')->nullable()->after('Trans_Id');
            $table->string('From_IFSC')->nullable()->after('From_Bank_Acc');
            $table->string('From_Bank_Name')->nullable()->after('From_IFSC');
            $table->string('From_Acc_type')->nullable()->after('From_Bank_Name');
            $table->string('From_Branch_Name')->nullable()->after('From_Acc_type');

            $table->string('To_Bank_Acc')->nullable()->after('From_Branch_Name');
            $table->string('To_IFSC')->nullable()->after('To_Bank_Acc');
            $table->string('To_Bank_Name')->nullable()->after('To_IFSC');
            $table->string('To_Acc_type')->nullable()->after('To_Bank_Name');
            $table->string('To_Branch_Name')->nullable()->after('To_Acc_type');
        });
    }

    public function down(): void
    {
        Schema::table('bank_trans_details', function (Blueprint $table) {
            $table->dropColumn([
                'From_Bank_Acc',
                'From_IFSC',
                'From_Bank_Name',
                'From_Acc_type',
                'From_Branch_Name',
                'To_Bank_Acc',
                'To_IFSC',
                'To_Bank_Name',
                'To_Acc_type',
                'To_Branch_Name',
            ]);
        });
    }
};
