-- ================================================================
-- 场地表结构检查和修复脚本
-- 用途：检查 martial_venue 表是否存在 max_capacity 字段，如果不存在则添加
-- 日期：2025-12-06
-- ================================================================

-- 检查表是否存在
SELECT
    TABLE_NAME,
    CASE
        WHEN TABLE_NAME IS NOT NULL THEN '表存在'
        ELSE '表不存在'
    END AS status
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE()
  AND TABLE_NAME = 'martial_venue';

-- 查看当前表结构
DESC martial_venue;

-- 查看所有字段
SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_DEFAULT, IS_NULLABLE, COLUMN_COMMENT
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
  AND TABLE_NAME = 'martial_venue'
ORDER BY ORDINAL_POSITION;
