<?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('polls', function (Blueprint $table) {
            // JSON: {"0": 150, "1": 80, "2": 45}
            // Added on top of real poll_votes when returning results to Flutter
            $table->json('manual_votes')->nullable()->after('poll_date');
        });
    }

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