<?php
require_once __DIR__ . '/../config/config.php';
$db = Database::getInstance();

$col = $db->fetch("SHOW COLUMNS FROM users LIKE 'advisor_requested'");
if ($col) {
    echo "Column advisor_requested already exists\n";
    exit(0);
}

try {
    $db->query("ALTER TABLE users ADD COLUMN advisor_requested TINYINT(1) DEFAULT 0 AFTER on_hold");
    echo "Added advisor_requested column to users\n";
} catch (Exception $e) {
    echo "Failed to add column: " . $e->getMessage() . "\n";
    exit(1);
}
