<?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('challenges', function (Blueprint $table) {
            // Simpan dalam menit, nullable agar data lama tidak error
            $table->unsignedSmallInteger('durasi_pengerjaan')->nullable()->after('tenggat_waktu')
                  ->comment('Durasi pengerjaan dalam menit. NULL = tidak ada batas durasi.');
        });
    }
 
    public function down(): void
    {
        Schema::table('challenges', function (Blueprint $table) {
            $table->dropColumn('durasi_pengerjaan');
        });
    }
};