<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('push_device_tokens', function (Blueprint $table) {
            $table->string('last_error', 100)->nullable()->after('is_active')->comment('마지막 FCM 에러 코드');
            $table->timestamp('last_error_at')->nullable()->after('last_error')->comment('마지막 에러 발생 시각');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('push_device_tokens', function (Blueprint $table) {
            $table->dropColumn(['last_error', 'last_error_at']);
        });
    }
};
