<?php
require_once __DIR__ . '/../src/Utils/Env.php';
require_once __DIR__ . '/../src/Config/Database.php';

use App\Utils\Env;
use App\Config\Database;

Env::load(__DIR__ . '/../../.env');
$db = Database::getInstance()->getConnection();

try {
    $db->exec("ALTER TABLE messages ADD COLUMN sender_alias VARCHAR(50) NULL");
    $db->exec("ALTER TABLE messages ADD COLUMN is_anonymous TINYINT(1) DEFAULT 0");
    echo "Migration successful: Added sender_alias and is_anonymous columns.";
} catch (PDOException $e) {
    echo "Migration info: " . $e->getMessage();
}
