Files
cattleTransportation/tradeCattle/add_landing_entruck_weight_field.sql
2025-10-21 09:01:11 +08:00

25 lines
879 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 表添加 landing_entruck_weight 字段
-- 字段类型DECIMAL(10,2)支持小数点后2位
-- 位置:在 sale_price 字段之后
-- 注释:约定单价(元/公斤)
ALTER TABLE delivery
ADD COLUMN firm_price DECIMAL(10,2) COMMENT '约定单价(元/公斤)'
AFTER sale_price;
-- 验证字段是否添加成功
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 = 'firm_price';
-- 显示完整的表结构
DESCRIBE delivery;