|
|
@@ -3727,6 +3727,11 @@ insertSysConfigSeed("gift_membership_pay_price", "198000", "送会员商品达
|
|
|
// food_disease_weight_group(能力键 food.ops.ruleManagement,CR-06 §4.6)
|
|
|
// 权重表由迁移501 落地;本迁移幂等:CREATE TABLE IF NOT EXISTS + try/catch
|
|
|
createFoodRuleManagementTables();
|
|
|
+
|
|
|
+ // 迁移509: 谷禾新版关键字段结构化落表(能力键 health.report.guheV2Schema,§三 P0-4 + §五 DDL①②③)
|
|
|
+ // fb_ratio / shannon_index_norm / subhealth_label / parse_self_check、similarity_level、
|
|
|
+ // reference_range / direction / species_code / functional_tag 从 payload 提出为可查询列;逐列幂等
|
|
|
+ createGuheV2SchemaColumns();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -17413,6 +17418,35 @@ log.info("迁移298: 已为无 openid 的 child 账号补齐 family_members 记
|
|
|
log.info("迁移503: 异常菌清单数据源已就绪(health_species_library + health_abnormal_species 视图/表)");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 迁移509: 谷禾新版关键字段结构化落表(能力键 {@code health.report.guheV2Schema},§三 P0-4 + §五 DDL①②③)。
|
|
|
+ *
|
|
|
+ * <p>把 guhe_v2 的关键字段从 payload 提出为可查询列,供前端与归因引擎使用:
|
|
|
+ * health_reports 的 fb_ratio / shannon_index_norm / subhealth_label / parse_self_check,
|
|
|
+ * health_disease_risk 的 similarity_level,
|
|
|
+ * health_gut_flora 的 reference_range / direction / species_code / functional_tag。</p>
|
|
|
+ *
|
|
|
+ * <p>幂等:优先用 {@link #ensureColumn(String, String, String)},列已存在时其重复列异常被忽略。</p>
|
|
|
+ */
|
|
|
+ void createGuheV2SchemaColumns() {
|
|
|
+ // §五 DDL① health_reports:F/B 比值、香农指数分级文字、亚健康标签、解析自检 JSON
|
|
|
+ ensureColumn("health_reports", "fb_ratio", "TEXT DEFAULT NULL COMMENT 'F/B比值(厚壁菌门/拟杆菌门)'");
|
|
|
+ ensureColumn("health_reports", "shannon_index_norm", "VARCHAR(32) DEFAULT NULL COMMENT '香农指数分级文字'");
|
|
|
+ ensureColumn("health_reports", "subhealth_label", "VARCHAR(64) DEFAULT NULL COMMENT '亚健康标签'");
|
|
|
+ ensureColumn("health_reports", "parse_self_check", "JSON NULL COMMENT '解析自检结果(_解析自检)'");
|
|
|
+
|
|
|
+ // §五 DDL② health_disease_risk:疾病相似评估[].status → similarity_level(低/中/高相似)
|
|
|
+ ensureColumn("health_disease_risk", "similarity_level", "VARCHAR(16) DEFAULT NULL COMMENT '相似度(低/中/高相似)'");
|
|
|
+
|
|
|
+ // §五 DDL③ health_gut_flora:参考范围原文、▲/▼方向、拉丁名、功能标签
|
|
|
+ ensureColumn("health_gut_flora", "reference_range", "VARCHAR(128) DEFAULT NULL COMMENT '参考范围原文'");
|
|
|
+ ensureColumn("health_gut_flora", "direction", "VARCHAR(2) DEFAULT NULL COMMENT '▲超标/▼偏低'");
|
|
|
+ ensureColumn("health_gut_flora", "species_code", "VARCHAR(128) DEFAULT NULL COMMENT '拉丁名(物种编码)'");
|
|
|
+ ensureColumn("health_gut_flora", "functional_tag", "VARCHAR(64) DEFAULT NULL COMMENT '功能标签'");
|
|
|
+
|
|
|
+ log.info("迁移509: 已补齐 guhe_v2 结构化列(health_reports / health_disease_risk / health_gut_flora)");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 迁移508: 任务五阶段提醒配置列(stage_enabled + 5 个阶段时间)。
|
|
|
* 幂等:逐列 ADD COLUMN,已存在时忽略异常。
|