forked from mailcarrierapp/mailcarrier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4_create_logs_table.php
46 lines (40 loc) · 1.24 KB
/
4_create_logs_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use MailCarrier\Models\Template;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('logs', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->foreignIdFor(Template::class)
->nullable()
->index()
->constrained()
->nullOnDelete();
$table->string('status')->index();
$table->string('trigger')->nullable()->index();
$table->string('subject');
$table->string('recipient');
$table->text('error')->nullable();
$table->json('sender');
$table->json('template_frozen')->nullable();
$table->json('variables')->nullable();
$table->json('cc')->nullable();
$table->json('bcc')->nullable();
$table->timestamps();
$table->index(['subject', 'recipient']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('logs');
}
};