pull/5125/head
Daniel Supernault 2024-05-31 03:17:54 -06:00
rodzic dc6b9f4661
commit 86ac10fab7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 36 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,36 @@
<?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('instances', function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('instances');
if (! array_key_exists('instances_nodeinfo_last_fetched_index', $indexesFound)) {
$table->index('nodeinfo_last_fetched');
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('instances', function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('instances');
if (array_key_exists('instances_nodeinfo_last_fetched_index', $indexesFound)) {
$table->dropIndex('instances_nodeinfo_last_fetched_index');
}
});
}
};