admin/sql/migrate_t_order_predeclare_fail_reason.sql
zzh d8752959e7 feat(order): 强化小包下单规则并暴露预报失败原因
客户单号必填且同客户唯一,运单号统一 NE 前缀自动生成;模板导入不再接受跟踪号/运单号;列表与导出返回预报失败原因字段。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 09:44:12 +08:00

12 lines
606 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.

-- t_order 预报失败原因(可重复执行)
-- 在 OMS 业务库执行:mysql -h<host> -u<user> -p<db> < migrate_t_order_predeclare_fail_reason.sql
SET @db = DATABASE();
SET @exist := (SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 't_order' AND COLUMN_NAME = 'PredeclareFailReason');
SET @sql := IF(@exist = 0,
'ALTER TABLE `t_order` ADD COLUMN `PredeclareFailReason` VARCHAR(512) NULL COMMENT ''预报失败原因'' AFTER `IsRemote`',
'SELECT ''skip PredeclareFailReason''');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;