Files
martial-master/database/martial-db/check_venue_table.sql
宅房 7aa6545cbb
All checks were successful
continuous-integration/drone/push Build is passing
fix bugs
2025-12-12 05:13:10 +08:00

27 lines
823 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ================================================================
-- 场地表结构检查和修复脚本
-- 用途:检查 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;