Indexes for performance improvements, improved FTN regex

This commit is contained in:
Deon George
2022-11-01 16:39:58 +11:00
parent 5334b7d615
commit 702c5fb4f2
3 changed files with 53 additions and 3 deletions

View File

@@ -0,0 +1,47 @@
<?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']);
});
}
};