<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        if (Schema::hasTable('user_profile_intros')) {
            return;
        }

        Schema::create('user_profile_intros', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->unique();
            $table->text('about')->nullable();
            $table->text('job_love')->nullable();
            $table->text('interests_hobbies')->nullable();
            $table->text('past_experience')->nullable();
            $table->json('quick_links')->nullable();
            $table->timestamps();

            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('user_profile_intros');
    }
};
