<?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()
{
    Schema::create('user_likes', function (Blueprint $table) {
        $table->id();

        $table->foreignId('user_id'); // اللي ضغط لايك
        $table->foreignId('liked_user_id'); // اللي انعمله لايك

        $table->timestamps();

        $table->unique(['user_id', 'liked_user_id']); // 🔥 يمنع التكرار
    });
}

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_likes');
    }
};
