Files
zkxw/docs/sql/migrations/2026-11-23-cell-product-spec-count-volume.sql
cykjandCursor c22a0d1eb0 feat(market): 完善临床科研与委托加工上线能力
补齐项目组负责人审批、费用信息、合作客户、生产出库菜单、申请单号 LCKY 前缀及配套 SQL 迁移,并同步相关前后端与单测。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-30 18:51:37 +08:00

21 lines
855 B
SQL
Raw Permalink 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.
-- 细胞产品规格:增加细胞数量(千万)、分装体积(ml),供临床科研/委托加工后期按千万细胞结算。
-- MySQL 5.7,可重复执行。目标库:测试库(如 zkxw-sc)。
-- 存量允许为空;新建/编辑由应用层必填。
SET @col_count := (
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'biz_cell_product_spec'
AND COLUMN_NAME = 'cell_count_qianwan'
);
SET @sql := IF(
@col_count = 0,
'ALTER TABLE biz_cell_product_spec
ADD COLUMN cell_count_qianwan DECIMAL(18,4) NULL COMMENT ''细胞数量(单位:千万)'' AFTER spec_name,
ADD COLUMN fill_volume_ml DECIMAL(18,4) NULL COMMENT ''分装体积(单位:ml)'' AFTER cell_count_qianwan',
'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;