<?php

use App\Models\PaymentManagement\PaymentMethod;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up(){
        Schema::whenTableDoesntHaveColumn((new PaymentMethod)->getTable(),"api_config",function (Blueprint $table){
            $table->json("api_config")->nullable()
                  ->comment("Les configurations d'api");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down(){
    }
};
