<?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('pw_shop', function (Blueprint $table) {
            $table->id();
            $table->integer('item_id');
            $table->string('item_name')->nullable();
            $table->integer('count')->default(1);
            $table->string('octet')->nullable();
            $table->integer('mask')->default(0);
            $table->integer('proctype')->default(0);
            $table->bigInteger('price')->default(0); // Gold price
            $table->boolean('is_active')->default(true);
            $table->timestamps();

            $table->index('item_id');
            $table->index('is_active');
        });
    }

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