<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('comment_reactions', function (Blueprint $table): void {
            $table->index(['created_at', 'id'], 'idx_comment_reactions_created_at');
        });

        Schema::table('user_mentions', function (Blueprint $table): void {
            $table->index(['created_at', 'id'], 'idx_user_mentions_created_at');
        });
    }

    public function down(): void
    {
        Schema::table('user_mentions', function (Blueprint $table): void {
            $table->dropIndex('idx_user_mentions_created_at');
        });

        Schema::table('comment_reactions', function (Blueprint $table): void {
            $table->dropIndex('idx_comment_reactions_created_at');
        });
    }
};