<?php
require_once 'config.php';
require_once 'includes/db.php';

try {
    // Add system_commission and min_withdrawal to site_settings
    $pdo->exec("ALTER TABLE site_settings ADD COLUMN system_commission DECIMAL(5,2) DEFAULT 0.00");
    $pdo->exec("ALTER TABLE site_settings ADD COLUMN min_withdrawal DECIMAL(10,2) DEFAULT 1000.00");
    echo "Successfully updated site_settings table with commission and withdrawal limit columns.\n";
} catch (PDOException $e) {
    if (strpos($e->getMessage(), 'Duplicate column name') !== false) {
        echo "Columns already exist.\n";
    } else {
        die("Database error: " . $e->getMessage());
    }
}
?>

