<?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('koleksis', function (Blueprint $table) {
            if (!Schema::hasColumn('koleksis', 'qr_code')) {
                $table->string('qr_code', 255)->nullable()->after('nomor_eksemplar');
            }
        });
    }

    public function down(): void
    {
        Schema::table('koleksis', function (Blueprint $table) {
            $table->dropColumn('qr_code');
        });
    }
};

