clrghouz/database/migrations/2023_08_05_205920_mail_recvtime.php

35 lines
834 B
PHP
Raw Permalink Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('netmail_path',function (Blueprint $table) {
$table->datetime('recv_at')->nullable();
});
DB::statement('UPDATE netmail_path SET recv_at=created_at FROM netmails WHERE netmails.id=netmail_path.netmail_id');
Schema::table('echomail_path',function (Blueprint $table) {
$table->datetime('recv_at')->nullable();
});
DB::statement('UPDATE echomail_path SET recv_at=created_at FROM echomails WHERE echomails.id=echomail_path.echomail_id');
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};