TempMailWeb/database/migrations/2023_10_30_062729_create_mails_table.php
2023-10-30 17:38:54 +08:00

37 lines
911 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('mails', function (Blueprint $table) {
$table->id();
$table->string('from');
$table->string('from_hash')->index();
$table->string('to')->index();
$table->string('to_hash')->index();
$table->string('title');
$table->longText('body');
$table->string('from_addr');
$table->string('from_protocol');
$table->timestamp('received_at');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mails');
}
};