<?php

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

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

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