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

20 lines
667 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.
-- ================================================================
-- 修复参赛选手表 order_id 字段约束
-- 问题Field 'order_id' doesn't have a default value
-- 解决:允许 order_id 为 NULL支持直接添加参赛选手无需订单
-- 日期2025-12-06
-- ================================================================
-- 使用正确的数据库
USE martial_db;
-- 修改 order_id 字段,允许为 NULL
ALTER TABLE martial_athlete
MODIFY COLUMN order_id bigint(20) NULL DEFAULT NULL COMMENT '订单ID';
-- 验证修改
DESC martial_athlete;
-- 显示修改结果
SELECT '✓ order_id 字段已修改为可空' AS ;