<?php

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

return new class extends Migration
{
    public function up()
    {
        Schema::create('user_mails', function (Blueprint $table) {
            $table->id();
            $table->foreignId('from');
            $table->foreignId('to');
            $table->foreignId('cc')->nullable();
            $table->text('subject')->nullable();
            $table->text('body')->nullable();
            $table->timestamp('read_at')->nullable();
            $table->boolean('status')->default(true);
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('user_mails');
    }
};
