<?php

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

class CreateAppointmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('appointments', function (Blueprint $table) {
            $table->id();
            $table->integer('contact_id')->nullable()->index();
            $table->integer('listing_id')->nullable()->index();
            $table->integer('guest_id')->nullable()->index();
            $table->integer('user_id')->nullable()->index();
            $table->integer('added_by')->nullable()->index();
            $table->string('title', 300)->nullable();
            $table->tinyInteger('type')->nullable()->index();
            $table->tinyInteger('appear_as')->nullable()->index();
            $table->dateTime('start')->nullable()->index();
            $table->dateTime('end')->nullable()->index();
            $table->string('location', 200)->nullable();
            $table->longText('description')->nullable();
            $table->longText('private_description')->nullable();
            $table->timestamps();
        });
    }

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