<?php

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

return new class extends Migration
{
    /**
     * Add sentiment enum column to r_poll_options for accurate sentiment classification.
     */
    public function up(): void
    {
        Schema::table('r_poll_options', function (Blueprint $table) {
            $table->enum('sentiment', ['positive', 'neutral', 'negative'])
                ->nullable()
                ->after('option_text')
                ->comment('Sentiment classification for the sentiment doughnut chart');
        });
    }

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