<?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();

echo "<pre>";

// Check users.real_user_id
try {
    $stmt = $db->query("SHOW COLUMNS FROM users LIKE 'real_user_id'");
    if ($stmt->fetch()) echo "users.real_user_id: EXISTS\n";
    else echo "users.real_user_id: MISSING\n";
} catch (Exception $e) { echo "users check error: " . $e->getMessage() . "\n"; }

// Check conversations.is_anonymous
try {
    $stmt = $db->query("SHOW COLUMNS FROM conversations LIKE 'is_anonymous'");
    if ($stmt->fetch()) echo "conversations.is_anonymous: EXISTS\n";
    else echo "conversations.is_anonymous: MISSING\n";
} catch (Exception $e) { echo "conversations check error: " . $e->getMessage() . "\n"; }

// Check messages.sender_alias
try {
    $stmt = $db->query("SHOW COLUMNS FROM messages LIKE 'sender_alias'");
    if ($stmt->fetch()) echo "messages.sender_alias: EXISTS\n";
    else echo "messages.sender_alias: MISSING\n";
} catch (Exception $e) { echo "messages check error: " . $e->getMessage() . "\n"; }

echo "</pre>";
