<?php

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

class CreateMailMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mail_messages', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedBigInteger('mail_id');
            $table->unsignedBigInteger('uid');
            $table->string('subject');
            $table->text('from');
            $table->text('to');
            $table->text('cc');
            $table->text('bcc');
            $table->text('reply_to');
            $table->longText('body');
            $table->text('attachments');
            $table->text('flags');
            $table->boolean('is_deleted')->default(0);
            $table->boolean('is_sent')->default(0);
            $table->timestamp('date');
            $table->timestamps();
        });
    }

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