<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            // Tracker si l'utilisateur a payé son produit d'investissement obligatoire
            if (!Schema::hasColumn('users', 'has_paid_investment_product')) { $table->boolean('has_paid_investment_product')->default(false); }
            if (!Schema::hasColumn('users', 'investment_product_paid_at')) { $table->timestamp('investment_product_paid_at')->nullable(); }
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['has_paid_investment_product', 'investment_product_paid_at']);
        });
    }
};


