<?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('emppers_profile', function (Blueprint $table) {
            $table->unsignedBigInteger('WOP_id')->nullable()->after('Status');
            $table->foreign('WOP_id')->references('WOP_id')->on('woff_pattern')->onDelete('set null');
        });
    }

    public function down(): void
    {
        Schema::table('emppers_profile', function (Blueprint $table) {
            $table->dropForeign(['WOP_id']);
            $table->dropColumn('WOP_id');
        });
    }
};
