<?php
require_once __DIR__ . '/config.php';

try {
    $stmt = $pdo->query("SELECT name FROM sqlite_master WHERE type='table' AND name='video_assets'");
    $result = $stmt->fetch(PDO::FETCH_ASSOC);
    echo "video_assets 表存在: " . ($result ? "是" : "否") . "\n";
    
    if ($result) {
        $stmt = $pdo->query("PRAGMA table_info(video_assets)");
        $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
        echo "表结构:\n";
        foreach ($columns as $col) {
            echo "  " . $col['name'] . " - " . $col['type'] . "\n";
        }
        
        $stmt = $pdo->query("SELECT COUNT(*) as cnt FROM video_assets");
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        echo "记录数: " . $row['cnt'] . "\n";
    }
} catch (PDOException $e) {
    echo "错误: " . $e->getMessage() . "\n";
}
?>
