admin/sql/migrate_t_order_declaration_sku_image.sql
zzh 43fcb4136a
All checks were successful
Build and Deploy / deploy (push) Successful in 1m48s
feat: SkuImage 存 storage key,包裹 summary,修复批次测试
避免签名 URL 超长写库;新增包裹状态汇总;OrderBatchJobCoordinator 注入 IFileStorage 后补齐单测。

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

28 lines
794 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_declaration.SkuImage:库内 SKU 选图后写入签名 URL 易超 VARCHAR(255)
-- 后端已改为存 storage key;列宽对齐仓库 SkuImageUrl,兼容外链
SET @db := DATABASE();
SET @need := (
SELECT COUNT(*)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db
AND TABLE_NAME = 't_order_declaration'
AND COLUMN_NAME = 'SkuImage'
AND (
DATA_TYPE <> 'varchar'
OR CHARACTER_MAXIMUM_LENGTH IS NULL
OR CHARACTER_MAXIMUM_LENGTH < 512
)
);
SET @sql := IF(
@need > 0,
'ALTER TABLE `t_order_declaration` MODIFY COLUMN `SkuImage` VARCHAR(512) NULL COMMENT ''图片(存 storage key 或短 URL)''',
'SELECT ''skip t_order_declaration.SkuImage'' AS msg'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;