Files
BMS/bms-back/sql/price/order_bill_receive_weight_alter.sql
T
2026-10-13 17:47:22 +08:00

17 lines
543 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.
-- prc_order_bill.receive_weight from upstream TAB_ORDER.WEIGHT
SET NAMES utf8mb4;
SET @col := (
SELECT COLUMN_NAME FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'prc_order_bill'
AND COLUMN_NAME = 'receive_weight'
LIMIT 1
);
SET @sql := IF(
@col IS NULL,
'ALTER TABLE prc_order_bill ADD COLUMN receive_weight decimal(10,3) DEFAULT NULL COMMENT ''收货重KG(上游TAB_ORDER.WEIGHT)'' AFTER actual_weight',
'SELECT 1'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;