Adding a couple of indexes that optimize queries

This commit is contained in:
Beshoy Girgis
2023-05-29 23:56:06 -05:00
parent fa088de963
commit 174334bd73
2 changed files with 56 additions and 0 deletions
@@ -0,0 +1,28 @@
<?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('release_files', function (Blueprint $table) {
$table->index(['crc32'], 'ix_releasefiles_crc32');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('release_files', function (Blueprint $table) {
$table->dropIndex('ix_releasefiles_crc32');
});
}
};
@@ -0,0 +1,28 @@
<?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('releases', function (Blueprint $table) {
$table->index(['categories_id', 'leftguid'], 'ix_releases_categories_id_leftguid');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('releases', function (Blueprint $table) {
$table->dropIndex('ix_releases_categories_id_leftguid');
});
}
};