<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddVerificationFieldsToLembarJawabIkk extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('lembar_jawab_ikk', function (Blueprint $table) {
            $table->text('catatan_verifikator')->nullable()->after('status');
            $table->foreignId('verified_by')->nullable()->after('catatan_verifikator')->constrained('users')->onDelete('set null');
            $table->timestamp('verified_at')->nullable()->after('verified_by');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('lembar_jawab_ikk', function (Blueprint $table) {
            $table->dropForeign(['verified_by']);
            $table->dropColumn(['catatan_verifikator', 'verified_by', 'verified_at']);
        });
    }
}
