admin/sql/migrate_t_order_consignee_country_name.sql
zzh fe30d071e6 feat(order): 修复列表状态筛选、收件国家名与小包轨迹同步
改用仓储链式 Where 修复分页列表状态过滤失效;保存并返回 ConsigneeCountryName;预报成功后异步 UpsertSmallBag;仅草稿/已预报可删除。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 19:43:35 +08:00

10 lines
425 B
SQL

-- t_order 增加收件国家中文名称
ALTER TABLE `t_order`
ADD COLUMN `ConsigneeCountryName` VARCHAR(64) NULL COMMENT '国家中文名称' AFTER `ConsigneeCountry`;
-- 历史数据:按二字码回填中文名
UPDATE `t_order` o
INNER JOIN `t_country` c ON c.`CountryCode` = o.`ConsigneeCountry`
SET o.`ConsigneeCountryName` = c.`ChineseName`
WHERE o.`ConsigneeCountryName` IS NULL OR o.`ConsigneeCountryName` = '';