48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreateEmailLogsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('email_logs', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->unsignedInteger('sender_user_id')->nullable(true);
|
|
$table->dateTime('queued_at')->nullable(true);
|
|
$table->dateTime('sent_at')->nullable(true);
|
|
$table->string('sender_name');
|
|
$table->string('sender_address');
|
|
$table->text('to_addresses');
|
|
$table->text('cc_addresses')->nullable(true);
|
|
$table->text('bcc_addresses')->nullable(true);
|
|
$table->string('subject');
|
|
$table->longText('body_plain');
|
|
$table->longText('body_html');
|
|
$table->integer('number_attempts')->default(0);
|
|
$table->timestamps();
|
|
|
|
$table->foreign('sender_user_id')
|
|
->references('id')->on('users')
|
|
->onDelete('cascade');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('email_logs');
|
|
}
|
|
}
|