All checks were successful
Build and Deploy / deploy (push) Successful in 1m0s
Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
640 B
SQL
23 lines
640 B
SQL
-- 订单增加下游服务商名称(排货确认时写入 itfx 服务商名 / 分组名)。
|
|
-- 可重复执行。
|
|
|
|
SET @db := DATABASE();
|
|
|
|
SET @exists := (
|
|
SELECT COUNT(1)
|
|
FROM information_schema.COLUMNS
|
|
WHERE TABLE_SCHEMA = @db
|
|
AND TABLE_NAME = 't_order'
|
|
AND COLUMN_NAME = 'DownstreamSupplierName'
|
|
);
|
|
|
|
SET @sql := IF(
|
|
@exists = 0,
|
|
'ALTER TABLE `t_order` ADD COLUMN `DownstreamSupplierName` VARCHAR(128) NULL COMMENT ''下游 API 服务商名称'' AFTER `DownstreamSupplierCode`',
|
|
'SELECT ''t_order.DownstreamSupplierName already exists'' AS info'
|
|
);
|
|
|
|
PREPARE stmt FROM @sql;
|
|
EXECUTE stmt;
|
|
DEALLOCATE PREPARE stmt;
|