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