<?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('post_comments', function (Blueprint $table) {
            $table->boolean('is_highlighted')->default(false)->after('body');
            $table->index(['post_id', 'is_highlighted']);
        });
    }

    public function down(): void
    {
        Schema::table('post_comments', function (Blueprint $table) {
            $table->dropIndex(['post_id', 'is_highlighted']);
            $table->dropColumn('is_highlighted');
        });
    }
};
