-- 添加处方用量相关字段
-- 用于存储处方类型对应的用量、单位和代煎信息

ALTER TABLE `zyt_tcm_prescription`
ADD COLUMN `dosage_amount` decimal(10,2) DEFAULT NULL COMMENT '用量数值' AFTER `prescription_type`,
ADD COLUMN `dosage_unit` varchar(10) NOT NULL DEFAULT '' COMMENT '用量单位(g/ml)' AFTER `dosage_amount`,
ADD COLUMN `need_decoction` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否代煎(0否1是,仅饮片)' AFTER `dosage_unit`;

-- 验证字段是否添加成功
SELECT COLUMN_NAME, DATA_TYPE, COLUMN_DEFAULT, COLUMN_COMMENT 
FROM information_schema.COLUMNS 
WHERE TABLE_SCHEMA = DATABASE() 
  AND TABLE_NAME = 'zyt_tcm_prescription' 
  AND COLUMN_NAME IN ('dosage_amount', 'dosage_unit', 'need_decoction')
ORDER BY ORDINAL_POSITION;
