<?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('maid_links', function (Blueprint $table) {
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_unicode_ci';
            $table->id();
            $table->unsignedTinyInteger('nationality_id');
            $table->string('meta_title')->nullable();
            $table->text('meta_description')->nullable();
            $table->text('meta_keywords')->nullable();
            $table->string('h1');
            $table->string('title')->nullable();
            $table->string('slug');
            $table->longText('content_en')->nullable();
            $table->longText('content_ar')->nullable();
            $table->string('image')->nullable();
            $table->timestamps();

            $table->unique('slug', 'maid_links_slug_unique');
            $table->index('nationality_id', 'maid_links_nationality_id_index');
        });
    }

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