<?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('institutions', function (Blueprint $table) {
            $table->dropForeign(['institution_type_id']);
            $table->dropColumn('institution_type_id');
        });
    }

    public function down(): void {
        Schema::table('institutions', function (Blueprint $table) {
            $table->foreignId('institution_type_id')->nullable()->constrained('institution_types');
        });
    }
};
