<?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 $table) {
            $table->dropForeign(['fk_owner']);
            $table->foreign('fk_owner')->references('id')->on('sc_users');
        });
    }

    public function down(): void
    {
        Schema::table('sy_sites', function (Blueprint $table) {
            $table->dropForeign(['fk_owner']);
            $table->foreign('fk_owner')->references('id')->on('ct_collaborators');
        });
    }
};
