<?php

use App\Database\Blueprint;
// use Illuminate\Database\Schema\Blueprint;
use App\Facades\Schema;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('supplier_services', function (Blueprint $table) {

            $table->id();
            $table->foreignId('supplier_id')->constrained()->onDelete('NO ACTION');
            $table->foreignId('service_id')->constrained()->onDelete('NO ACTION');
            $table->timestamps();
            $table->userIdFields();

            /*
            $table->id();
            $table->bigInteger('supplier_id')->unsigned();
            $table->bigInteger('supplier_service_id')->unsigned();
            $table->foreign('supplier_id')->references('id')->on('suppliers');
            $table->foreign('supplier_service_id')->references('id')->on('upplier_services');
            $table->timestamps();
            */

        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('supplier_services', function (Blueprint $table) {
            Schema::dropIfExists('supplier_services');
        });
    }
};
