<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('buku', function (Blueprint $table) {
            $table->id(); // bigint primary key
            $table->string('judul', 150);
            $table->string('pengarang', 100);
            $table->string('penerbit', 100);
            $table->integer('tahun_terbit');
            $table->string('isbn', 20);
            $table->enum('kategori', ['Novel', 'Cerita', 'Pelajaran']);
            $table->integer('jumlah'); // jumlah buku tersedia
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('buku');
    }
};
