<?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('lms_courses', function (Blueprint $table) {
            $table->longText('description')->nullable()->change();
        });

        Schema::table('lms_course_settings', function (Blueprint $table) {
            $table->longText('instructions')->nullable()->change();
            $table->longText('completion_message')->nullable()->change();
        });

        Schema::table('lms_course_sections', function (Blueprint $table) {
            $table->longText('description')->nullable()->change();
        });

        Schema::table('lms_course_lessons', function (Blueprint $table) {
            $table->longText('content')->nullable()->change();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('lms_courses', function (Blueprint $table) {
            $table->text('description')->nullable()->change();
        });

        Schema::table('lms_course_settings', function (Blueprint $table) {
            $table->text('instructions')->nullable()->change();
            $table->text('completion_message')->nullable()->change();
        });

        Schema::table('lms_course_sections', function (Blueprint $table) {
            $table->text('description')->nullable()->change();
        });

        Schema::table('lms_course_lessons', function (Blueprint $table) {
            $table->text('content')->nullable()->change();
        });
    }
};
