<?php

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

class AddRelationshipFieldsToCurrencyRatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('currency_rates', function (Blueprint $table) {
            $table->unsignedBigInteger('currency_from_id')->nullable();
            $table->foreign('currency_from_id', 'currency_from_fk_9646634')->references('id')->on('currencies')->onDelete('cascade');
            $table->unsignedBigInteger('currency_to_id')->nullable();
            $table->foreign('currency_to_id', 'currency_to_fk_9646635')->references('id')->on('currencies')->onDelete('cascade');;
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('currency_rates', function (Blueprint $table) {
            //
        });
    }
}
