<?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::table('products', function (Blueprint $table) {
            $table->decimal('compare_at_price', 10, 2)->nullable();
            $table->decimal('cost_price', 10, 2)->nullable();
            $table->string('barcode')->nullable();
            $table->integer('security_stock')->nullable()->default(0);
            $table->date('published_at')->nullable();
            $table->boolean('can_be_returned')->default(true);
            $table->boolean('will_be_shipped')->default(true);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn([
                'compare_at_price',
                'cost_price',
                'barcode',
                'security_stock',
                'published_at',
                'can_be_returned',
                'will_be_shipped',
            ]);
        });
    }
};
