<?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('access_logs', function (Blueprint $table) {
            $table->foreignId('user_id')->nullable()->change();
            $table->foreignId('server_resource_id')->nullable()->change();
            $table->string('protocol', 16)->nullable()->change();
        });
    }

    public function down(): void
    {
        Schema::table('access_logs', function (Blueprint $table) {
            $table->foreignId('user_id')->nullable(false)->change();
            $table->foreignId('server_resource_id')->nullable(false)->change();
            $table->string('protocol', 16)->nullable(false)->change();
        });
    }
};
