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

41 lines
2.0 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.
-- ================================================================
-- 场地表字段修复脚本
-- 用途:为 martial_venue 表添加缺失的 max_capacity 字段
-- 问题Error: Unknown column 'max_capacity' in 'field list'
-- 日期2025-12-06
-- ================================================================
-- 方案1直接 DROP 表并重新创建(如果表中没有重要数据)
-- 如果表中有数据请跳过此步骤使用方案2
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;
SELECT '场地表已重新创建,包含 max_capacity 字段' AS result;