All checks were successful
Build and Deploy / deploy (push) Successful in 1m49s
用 MatchCondition 中文公式筛选可用渠道后再按方案选渠;失败时落完整排货过程(阶段、公式摘要、池汇总),并兼容旧 CustomerIds。 Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
738 B
SQL
22 lines
738 B
SQL
-- 存量库:排货规则服务商表增加判断条件 MatchCondition
|
||
-- 可重复执行;仅在列不存在时 ADD。
|
||
-- 目标表:t_sales_product_allocation_provider
|
||
|
||
SET @db := DATABASE();
|
||
|
||
SET @exists := (
|
||
SELECT COUNT(1)
|
||
FROM information_schema.COLUMNS
|
||
WHERE TABLE_SCHEMA = @db
|
||
AND TABLE_NAME = 't_sales_product_allocation_provider'
|
||
AND COLUMN_NAME = 'MatchCondition'
|
||
);
|
||
SET @sql := IF(
|
||
@exists = 0,
|
||
'ALTER TABLE `t_sales_product_allocation_provider` ADD COLUMN `MatchCondition` TEXT NULL COMMENT ''排货判断条件(中文公式),空表示全部订单可用'' AFTER `CustomerIds`',
|
||
'SELECT ''MatchCondition already exists'' AS info'
|
||
);
|
||
PREPARE stmt FROM @sql;
|
||
EXECUTE stmt;
|
||
DEALLOCATE PREPARE stmt;
|