<?php
require_once __DIR__ . '/../config/config.php';
$db = Database::getInstance();
$col = $db->fetch("SHOW COLUMNS FROM users LIKE 'avatar_url'");
if ($col) {
    echo "Column avatar_url already exists\n";
    exit(0);
}
try {
    $db->query("ALTER TABLE users ADD COLUMN avatar_url VARCHAR(255) NULL AFTER name");
    echo "Added column avatar_url\n";
} catch (Exception $e) {
    echo "Failed to add avatar_url: " . $e->getMessage() . "\n";
    exit(1);
}
