pixelfed/database/migrations/2022_10_07_110644_add_item_...

35 wiersze
798 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddItemIdAndItemTypeIndexesToNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('notifications', function (Blueprint $table) {
$table->index('item_id');
$table->index('item_type');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('notifications', function (Blueprint $table) {
$table->dropIndex('notifications_item_id_index');
$table->dropIndex('notifications_item_type_index');
});
}
}