<?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('products', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->text('description')->nullable();
            $table->string('price')->nullable();
            $table->string('promo_price')->nullable();
            $table->string('image')->default('assets/images/laptop.png');
            $table->string('category')->default('ebook');
            $table->text('shopee_url')->nullable();
            $table->text('tokopedia_url')->nullable();
            $table->text('va_details')->nullable();
            $table->integer('stock')->default(-1);
            $table->integer('is_active')->default(1);
            $table->integer('sort_order')->default(0);
            $table->timestamps();
        });
    }

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