<?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('vendor_provider_services', function (Blueprint $table) {
            $table->id();
            $table->foreignId('vendor_id')->constrained('vendors')->onDelete('cascade');
            $table->foreignId('provider_service_id')->constrained('provider_services')->onDelete('cascade');
            $table->unique(['vendor_id', 'provider_service_id']); // no duplicates
            $table->timestamps();
        });
    }

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