<?php

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

class Create1556008283SecretBuyerRatingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(! Schema::hasTable('secret_buyer_ratings')) {
            Schema::create('secret_buyer_ratings', function (Blueprint $table) {
                $table->increments('id');
                $table->double('position', 4, 2)->nullable();
                $table->double('infrastructure', 4, 2)->nullable();
                $table->double('transport_hub', 4, 2)->nullable();
                $table->double('planning', 4, 2)->nullable();
                $table->double('price_quality', 4, 2)->nullable();
                $table->tinyInteger('enabled')->nullable()->default('0');
                $table->string('youtube_link')->nullable();
                
                $table->timestamps();
                $table->softDeletes();

                $table->index(['deleted_at']);
            });
        }
    }

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