<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateMessagesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('messages', function (Blueprint $table) { $table->id(); $table->unsignedInteger('customer_id'); $table->unsignedInteger('campaign_id')->nullable(); $table->text('body'); $table->longText('emails')->comment('array of contact emails'); $table->dateTime('schedule_datetime')->nullable(); $table->enum('type',['inbox','sent'])->nullable(); $table->enum('read',['yes','no'])->default('no'); $table->text('message_files')->nullable()->comment('MMS files in json encoded'); $table->string('from_name')->nullable(); $table->string('reply_to')->nullable(); $table->string('subject')->nullable(); $table->timestamps(); $table->softDeletes(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('messages'); } }