<?php
require_once __DIR__ . '/config.php';
$db = getDB();

// Verificar si la tabla existe
try {
    $stmt = $db->query("SHOW TABLES LIKE 'admin_sessions'");
    $exists = $stmt->fetchColumn();
    
    if ($exists) {
        $cols = $db->query("SHOW COLUMNS FROM admin_sessions")->fetchAll();
        jsonOk(['table_exists' => true, 'columns' => $cols]);
    } else {
        jsonOk(['table_exists' => false, 'message' => 'tabla no existe, se creará en primer login']);
    }
} catch (Throwable $e) {
    jsonErr(500, $e->getMessage());
}
