<?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('productos_variantes', function (Blueprint $table) {
            $table->string('inventory_policy')->default('tracked')->after('producto_id');
            $table->unsignedBigInteger('cantidad_vendida')->default(0)->after('stock_reservado');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('productos_variantes', function (Blueprint $table) {
            $table->dropColumn(['inventory_policy', 'cantidad_vendida']);
        });
    }
};
