Add index migration

pull/3977/head
Daniel Supernault 2022-12-20 01:03:19 -07:00
rodzic a2f8aad1d5
commit e27d1a4424
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
2 zmienionych plików z 34 dodań i 1 usunięć

Wyświetl plik

@ -27,7 +27,8 @@ class AddItemIdAndItemTypeIndexesToNotificationsTable extends Migration
public function down()
{
Schema::table('notifications', function (Blueprint $table) {
//
$table->dropIndex('notifications_item_id_index');
$table->dropIndex('notifications_item_type_index');
});
}
}

Wyświetl plik

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('notifications', function (Blueprint $table) {
$table->index('action');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('notifications', function (Blueprint $table) {
$table->dropIndex('notifications_action_index');
});
}
};