WMS/sql/20260717_add_other_out.sql

23 lines
731 B
SQL
Raw Permalink 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.

-- ERP事项一:领料出库接口
-- 执行范围:default(线边库)和 cp(成品库)都执行。
-- 原因:InventoryTransaction 是两套数据库共用的实体模型。
-- 脚本可重复执行。
SET @column_exists = (
SELECT COUNT(*)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'InventoryTransaction'
AND COLUMN_NAME = 'UploadErpFlag'
);
SET @ddl = IF(
@column_exists = 0,
'ALTER TABLE `InventoryTransaction` ADD COLUMN `UploadErpFlag` INT NULL COMMENT ''ERP回传状态:0失败,1成功''',
'SELECT ''InventoryTransaction.UploadErpFlag already exists'' AS Message'
);
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;