Update migration, fixes #4863

pull/4866/head
Daniel Supernault 2024-01-15 22:43:09 -07:00
rodzic 85a612742d
commit 979aa55135
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -25,7 +25,11 @@ return new class extends Migration
});
Schema::table('user_roles', function (Blueprint $table) {
$table->dropIndex('user_roles_profile_id_unique');
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('user_roles');
if (array_key_exists('user_roles_profile_id_unique', $indexesFound)) {
$table->dropIndex('user_roles_profile_id_unique');
}
$table->unsignedBigInteger('profile_id')->unique()->nullable()->index()->change();
});
}