<?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('buku', function (Blueprint $table) {
            $table->float('lokasi_x')->nullable()->after('cover')->comment('Posisi X pin pada denah (persentase 0-100)');
            $table->float('lokasi_y')->nullable()->after('lokasi_x')->comment('Posisi Y pin pada denah (persentase 0-100)');
        });
    }

    public function down(): void
    {
        Schema::table('buku', function (Blueprint $table) {
            $table->dropColumn(['lokasi_x', 'lokasi_y']);
        });
    }
};
