<?php

use App\Models\OrderManagement\OrderProduct;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {

    public function up(){
        Schema::whenTableDoesntHaveColumn((new OrderProduct)->getTable(),"id",function (Blueprint $table){
            $table->id();
        });

        Schema::whenTableDoesntHaveColumn((new OrderProduct)->getTable(),"price",function (Blueprint $table){
            $table->float('price')->nullable()
                ->comment("Le prix unitaire");
        });
    }
};
