<?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
    {
        // Add language fields to competency_units table
        Schema::table('competency_units', function (Blueprint $table) {
            $table->string('title_en')->nullable()->after('title');
            $table->string('title_fr')->nullable()->after('title_en');
        });

        // Add language fields to competencies table
        Schema::table('competencies', function (Blueprint $table) {
            $table->text('description_en')->nullable()->after('description');
            $table->text('description_fr')->nullable()->after('description_en');
        });
    }

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

        Schema::table('competencies', function (Blueprint $table) {
            $table->dropColumn(['description_en', 'description_fr']);
        });
    }
};
