Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
825 B
2
Indexable
Never
<?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(): void
    {
        Schema::create('company_contact', function (Blueprint $table) {
            $table->id();
            $table->foreignId('contact_id')->constrained();
            $table->foreignId('company_id')->constrained();
            $table->boolean('is_point_of_contact');
            $table->json('roles')->nullable();
            $table->unique(['contact_id', 'company_id']);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('company_contacts');
    }
};
Leave a Comment