<?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('clients', function (Blueprint $table) {
            //$table->dropColumn('type_of_case');

            $table->string('type_of_case')->change();
            $table->unsignedBigInteger('solution_id')->nullable()->after('type_of_case');
            $table->foreign('solution_id')->references('id')->on('solutions')->onDelete('cascade');

            $table->unsignedBigInteger('academy_id')->nullable()->after('solution_id');
            $table->foreign('academy_id')->references('id')->on('academies')->onDelete('cascade');

            $table->string('other')->nullable()->after('academy_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {

    }
};
