<?php

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

class Create1564569994CustomerAppealsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(! Schema::hasTable('customer_appeals')) {
            Schema::create('customer_appeals', function (Blueprint $table) {
                $table->increments('id');
                $table->string('phone')->nullable();
                $table->text('question')->nullable();
                $table->tinyInteger('call_now')->nullable()->default('0');
                $table->datetime('call_time')->nullable();
                $table->tinyInteger('request_processed')->nullable()->default('0');
                
                $table->timestamps();
                $table->softDeletes();

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

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