<?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
    {
        Schema::create('user_profiles', function (Blueprint $table) {
            $table->unsignedBigInteger('user_id')->primary();

            $table->text('bio')->nullable();
            $table->string('avatar', 255)->nullable();
            $table->string('cover_image', 255)->nullable();

            $table->string('country', 80)->nullable();
            $table->char('country_code', 2)->nullable();
            $table->string('language', 10)->nullable();

            $table->date('birthdate')->nullable();
            $table->enum('gender', ['M','F','X'])->default('X');

            $table->string('website', 255)->nullable();

            $table->timestamps();

            $table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('user_profiles');
    }
};
