<?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('approvals', function (Blueprint $table) {
            $table->text('recall_reason')->nullable()->after('completed_at')
                ->comment('회수 사유');
            $table->foreignId('parent_doc_id')->nullable()->after('recall_reason')
                ->comment('재기안 원본 문서');
        });
    }

    public function down(): void
    {
        Schema::table('approvals', function (Blueprint $table) {
            $table->dropColumn(['recall_reason', 'parent_doc_id']);
        });
    }
};
