<?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->timestamps();

      $table->string('image');
      $table->json('images');
      $table->json('colors')->nullable();
      $table->string('brand')->nullable();
      $table->json('categories')->nullable();
      $table->string('name');
      $table->text('description');
      $table->decimal('price', 10, 2);
      $table->decimal('old_price', 10, 2)->nullable();
      $table->boolean('is_bestseller')->default(false);
      $table->boolean('is_featured')->default(false);
      $table->boolean('is_new')->default(false);
    });
  }

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