clrghouz/database/migrations/2022_10_23_092332_seenby_index.php

48 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('echomail_seenby', function (Blueprint $table) {
$table->index(['echomail_id','address_id']);
$table->index(['packet']);
$table->index(['sent_at']);
$table->index(['export_at']);
});
Schema::table('echomails', function (Blueprint $table) {
$table->index(['msgid']);
$table->index(['replyid']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('echomails', function (Blueprint $table) {
$table->dropIndex(['msgid']);
$table->dropIndex(['replyid']);
});
Schema::table('echomail_seenby', function (Blueprint $table) {
$table->dropIndex(['packet']);
$table->dropIndex(['sent_at']);
$table->dropIndex(['export_at']);
$table->dropIndex(['echomail_id','address_id']);
});
}
};