WMS/sql/20260717_add_sale_out.sql

23 lines
737 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.

-- ERP事项二:成品发货接口联动
-- 执行范围:default(线边库)和 cp(成品库)都执行。
-- 原因:ShipmentDetail 是两套数据库共用的实体模型;线边库必须同步字段以兼容原页面。
-- 脚本可重复执行。
SET @column_exists = (
SELECT COUNT(*)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'ShipmentDetail'
AND COLUMN_NAME = 'DLsID'
);
SET @ddl = IF(
@column_exists = 0,
'ALTER TABLE `ShipmentDetail` ADD COLUMN `DLsID` BIGINT NULL COMMENT ''ERP发货通知单表体明细ID''',
'SELECT ''ShipmentDetail.DLsID already exists'' AS Message'
);
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;