<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * 결제 대기 상태(pending)에서는 paid_at이 null이어야 하므로 nullable로 변경
     */
    public function up(): void
    {
        Schema::table('payments', function (Blueprint $table) {
            $table->datetime('paid_at')->nullable()->change();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('payments', function (Blueprint $table) {
            $table->datetime('paid_at')->nullable(false)->change();
        });
    }
};
