<?php

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

class CreateLeadsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('leads', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('reference_number')->nullable();
            $table->integer('lead_type_id')->nullable()->index();
            $table->integer('lead_category_id')->nullable()->index();
            $table->integer('lead_primary_source_id')->nullable()->index();
            $table->integer('lead_secondary_source_id')->nullable()->index();
            $table->integer('property_type_id')->nullable()->index();
            $table->integer('lead_status_id')->nullable()->index();
            $table->integer('lead_interest_level_id')->nullable()->index();
            $table->integer('assign_to')->nullable()->index();
            $table->string('title', 100)->nullable()->index();
            $table->string('phone', 50)->nullable()->index();
            $table->string('name', 50)->nullable()->index();
            $table->string('email', 50)->nullable()->index();
            $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('leads');
    }
}
