<?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('company_employees', function (Blueprint $table) {
            $table->string('submission_token', 64)->nullable()->unique()->after('portal_user_id');
            $table->timestamp('submission_token_sent_at')->nullable()->after('submission_token');
            $table->timestamp('submission_token_used_at')->nullable()->after('submission_token_sent_at');
        });
    }

    public function down(): void
    {
        Schema::table('company_employees', function (Blueprint $table) {
            $table->dropColumn(['submission_token', 'submission_token_sent_at', 'submission_token_used_at']);
        });
    }
};
