<?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('institutions', function (Blueprint $table)
        {
            $table->id();
            $table->uuid('slug');
            $table->foreignId('institution_type_id')->constrained();
            $table->foreignId('dsar_type_id')->nullable()->constrained('dsar_types')->nullOnDelete();
            $table->string('display_name');
            $table->enum('send_type', ['post', 'email'])->nullable()->default(null);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void {
        Schema::dropIfExists('institutions');
    }
};
