<?php

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

class CreateCallingDatabasesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('calling_databases', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('reference_number')->nullable();
            $table->integer('cd_status_id')->nullable()->index();
            $table->integer('cd_category_id')->nullable()->index();
            $table->integer('assign_to')->nullable()->index();
            $table->string('phone', 50)->nullable()->index();
            $table->string('name', 50)->nullable()->index();
            $table->string('email', 50)->nullable()->index();
            $table->string('unit_no', 50)->nullable()->index();
            $table->string('tower', 100)->nullable();
            $table->string('district', 100)->nullable();
            $table->string('city', 100)->nullable();
            $table->string('country', 100)->nullable();
            $table->string('property_type', 100)->nullable();
            $table->string('description', 1000)->nullable();
            $table->string('converted_to', 20)->nullable();
            $table->integer('added_by')->nullable()->index();
            $table->integer('updated_by')->nullable()->index();
            $table->integer('deleted_by')->nullable()->index();
            $table->softDeletes();
            $table->timestamps();
        });
    }

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