Files
cattleTransportation/tradeCattle/add_landing_entruck_weight_field.sql
2025-10-21 17:29:52 +08:00

25 lines
878 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.

-- =============================================
-- 数据库迁移脚本:为 delivery 表添加 landing_entruck_weight 字段
-- 用途:存储落地过磅重量
-- 创建时间2025-01-27
-- 数据库MySQL
-- =============================================
-- 为 delivery 表添加 landingEntruck_weight 字段
-- 字段类型DECIMAL(10,2)支持小数点后2位
-- 位置:在 entruck_weight 字段之后
-- 注释:落地过磅重量
ALTER TABLE delivery
ADD COLUMN landingEntruck_weight DECIMAL(10,2) COMMENT '落地过磅重量'
AFTER entruck_weight;
-- 验证字段是否添加成功
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT, COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'delivery'
AND COLUMN_NAME = 'landingEntruck_weight';
-- 显示完整的表结构
DESCRIBE delivery;