<?php

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

return new class extends Migration
{
    /**
     * Jalankan migrasi untuk menambah kolom.
     */
    public function up(): void
    {
        Schema::table('stok_akhir', function (Blueprint $table) {
            // Menambahkan kolom nama_produk setelah kolom id_stok
            $table->string('nama_produk', 12)->after('id_stok')->nullable();
        });
    }

    /**
     * Batalkan migrasi (rollback).
     */
    public function down(): void
    {
        Schema::table('stok_akhir', function (Blueprint $table) {
            $table->dropColumn('nama_produk');
        });
    }
};