<?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::create('applicants', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('job_id');
            $table->string('firstname', 150);
            $table->string('middlename')->nullable();
            $table->string('lastname', 150);
            $table->string('address', 250);
            $table->string('contact_number', 20);
            $table->string('email', 20);
            $table->string('last_position', 20);
            $table->string('last_salary', 20);
            $table->longText('cover_letter')->nullable();
            $table->string('resume', 100)->nullable();
            $table->tinyInteger('status')->default(0);
            $table->boolean('enabled')->default(true)->index();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('applicants');
    }
};
