<?php

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

class CreateStoreCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('store_comments', function (Blueprint $table) {
            $table->id();
            $table->integer('store_id');
            $table->string('author')->nullable();
            $table->float('rate', 3, 1)->default(0);
            $table->text('content')->nullable();
            $table->string('image')->nullable();
            $table->integer('parent_id')->default(0);
            $table->boolean('is_activated')->default(true);
            $table->boolean('is_deleted')->default(false);
            $table->timestamps();
        });
    }

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