Files
martial-master/database/martial-db/URGENT_FIX_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

54 lines
2.3 KiB
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.
-- ================================================================
-- 【紧急修复】场地表字段缺失问题 - 直接复制执行此脚本
-- 问题Unknown column 'max_capacity' in 'field list'
-- 解决:重建 martial_venue 表,包含所有必需字段
-- 日期2025-12-06
-- ================================================================
-- 使用正确的数据库
USE martial_db;
-- 删除旧表(如果有重要数据,请先备份!)
DROP TABLE IF EXISTS `martial_venue`;
-- 创建新表,包含完整字段
CREATE TABLE `martial_venue` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
`competition_id` bigint(20) NOT NULL COMMENT '赛事ID',
`venue_name` varchar(100) NOT NULL COMMENT '场地名称',
`venue_code` varchar(50) DEFAULT NULL COMMENT '场地编码',
`max_capacity` int(11) DEFAULT 100 COMMENT '最大容纳人数',
`location` varchar(200) DEFAULT NULL COMMENT '位置/地点',
`description` varchar(500) DEFAULT NULL COMMENT '场地描述',
`facilities` varchar(500) DEFAULT NULL COMMENT '场地设施',
`sort_order` int(11) DEFAULT 0 COMMENT '排序',
`status` int(2) DEFAULT 1 COMMENT '状态(0-禁用,1-启用)',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`is_deleted` int(2) DEFAULT 0 COMMENT '是否已删除',
PRIMARY KEY (`id`),
KEY `idx_competition_id` (`competition_id`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='场地信息表';
-- 验证表已创建成功
DESC martial_venue;
-- 检查 max_capacity 字段
SELECT '✓ martial_venue 表已成功重建,包含 max_capacity 字段' AS ;
-- 显示所有字段
SELECT
COLUMN_NAME AS ,
COLUMN_TYPE AS ,
COLUMN_DEFAULT AS ,
COLUMN_COMMENT AS
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'martial_db'
AND TABLE_NAME = 'martial_venue'
ORDER BY ORDINAL_POSITION;