<?php

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

class AddRateTypeToGameRates extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('game_rates', function (Blueprint $table) {
           $table->unsignedBigInteger('rate_type')->index()->nullable()->after('close_time');
            $table->foreign('rate_type')->references('id')->on('rate_types')->onDelete('cascade');
        });
    }

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