<?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('users', function (Blueprint $table) {
            $table->string('first_name')->nullable()->after('name');
            $table->string('last_name')->nullable()->after('first_name');
            $table->string('user_category')->nullable()->after('email');
            $table->string('user_type')->nullable()->after('user_category');
            $table->string('license_number')->nullable()->after('user_type');
            $table->string('student_id_number')->nullable()->after('license_number');
            $table->string('student_id_file')->nullable()->after('student_id_number');
            $table->string('preferred_language')->default('en')->after('student_id_file');
            $table->boolean('is_active')->default(true)->after('preferred_language');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn([
                'first_name',
                'last_name',
                'user_category',
                'user_type',
                'license_number',
                'student_id_number',
                'student_id_file',
                'preferred_language',
                'is_active',
            ]);
        });
    }
};
