<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('report_reasons', function (Blueprint $table) {
            $table->string('type')->default('Both'); // Chat, Review, Both
        });

        // Update default reasons to match appropriate scopes
        DB::table('report_reasons')->where('reason', 'Harassment or stalking')->update(['type' => 'Chat']);
        DB::table('report_reasons')->where('reason', 'Off-platform payment request')->update(['type' => 'Chat']);
        DB::table('report_reasons')->where('reason', 'Spam or promotional messaging')->update(['type' => 'Chat']);
    }

    public function down(): void
    {
        Schema::table('report_reasons', function (Blueprint $table) {
            $table->dropColumn('type');
        });
    }
};
