<?php

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

class CreateChakriRatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('chakri_rates', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('chakri_game_id')->index();
            $table->double('rate',8,2)->index();
            $table->boolean('status')->index()->default(true);
            $table->foreign('chakri_game_id')->references('id')->on('chakri_games')->onDelete('cascade');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('chakri_rates');
    }
}
