<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ChangeForeignkeyTypeInActivebankTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('setting_active_banks', function(Blueprint $table)
        {
            $table->dropForeign('setting_active_banks_x1_bank_id_foreign');
            $table->foreign('x1_bank_id')
            ->references('acc_no')->on('setting_malaysia_banks');
            
            $table->dropForeign('setting_active_banks_x2_bank_id_foreign');
            $table->foreign('x2_bank_id')
            ->references('acc_no')->on('setting_malaysia_banks');

            $table->dropForeign('setting_active_banks_beneficiary_id_foreign');
            $table->foreign('beneficiary_id')
            ->references('acc_no')->on('setting_beneficiaries');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
