<?php

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

class AddPresentationPhoneTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('presentation_phones', function (Blueprint $table) {
            $table->increments('id');
            $table->string('phone')->nullable();
            $table->integer('residential_complex_id')->unsigned()->nullable();
            $table->foreign('residential_complex_id')
                ->references('id')
                ->on('residential_complexes')
                ->onDelete('set null');

            $table->timestamps();
            $table->softDeletes();

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

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
