Moves tables indexes into initial table migrations

We can do this kind of crap until launch
This commit is contained in:
Refringe 2024-06-27 00:05:14 -04:00
parent 54255b46e9
commit 27361b6128
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k
4 changed files with 6 additions and 38 deletions

View File

@ -27,6 +27,8 @@ return new class extends Migration
$table->boolean('disabled')->default(false);
$table->softDeletes();
$table->timestamps();
$table->index(['deleted_at', 'disabled'], 'mods_show_index');
});
}

View File

@ -15,6 +15,8 @@ return new class extends Migration
$table->string('color_class');
$table->softDeletes();
$table->timestamps();
$table->index(['version', 'deleted_at'], 'spt_versions_filtering_index');
});
}

View File

@ -23,6 +23,8 @@ return new class extends Migration
$table->boolean('disabled')->default(false);
$table->softDeletes();
$table->timestamps();
$table->index(['mod_id', 'deleted_at', 'disabled', 'version'], 'mod_versions_filtering_index');
});
}

View File

@ -1,38 +0,0 @@
<?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('mods', function (Blueprint $table) {
$table->index(['deleted_at', 'disabled'], 'mods_show_index');
});
Schema::table('mod_versions', function (Blueprint $table) {
$table->index(['mod_id', 'deleted_at', 'disabled', 'version'], 'mod_versions_filtering_index');
});
Schema::table('spt_versions', function (Blueprint $table) {
$table->index(['version', 'deleted_at'], 'spt_versions_filtering_index');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('mods', function (Blueprint $table) {
$table->dropIndex('mods_show_index');
$table->dropIndex('mod_versions_filtering_index');
$table->dropIndex('spt_versions_filtering_index');
});
}
};