<?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::table('sy_sites', function (Blueprint $blueprint) {
            $blueprint->foreign('fk_owner')->references('id')->on('ct_collaborators');
            $blueprint->foreign('fk_usercreator')->references('id')->on('sc_users');
            $blueprint->foreign('fk_userupdater')->references('id')->on('sc_users');
        });
    }

    public function down(): void
    {
        Schema::table('sy_sites', function (Blueprint $blueprint) {
            $blueprint->dropForeign(['fk_usercreator', 'fk_userupdater', 'fk_owner']);
        });
    }
};
