Merge pull request #1452 from egyptianbman/indexes

Add a couple of indexes that optimize queries
This commit is contained in:
DariusIII
2023-11-12 18:00:24 +01:00
committed by GitHub
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');
});
}
};