فهرست منبع

fix(cfc-backend): health_reports补subject_id列 + 迁移32供商体系表(4张新表+product_orders 3列)

- ensureColumn health_reports.subject_id (匹配HealthReport实体, 修复
  EnergyService.calculateBodyScore Unknown column 'subject_id' 错误)
- 迁移32: 创建supply_system/supply_system_member/supply_settlement/
  supply_settlement_detail 4张表 + product_orders追加supply_system_id/
  supplier_id/supply_commission 3列+索引 (修复OrderTimeoutCancelTask
  Unknown column 'supply_system_id' 错误)
Xiaogang Liao 2 ماه پیش
والد
کامیت
458a57bfe6
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java

+ 3 - 0
cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java

@@ -3707,6 +3707,9 @@ try {
             log.warn("为health_reports表添加字段可能已存在: {}", e.getMessage());
             log.warn("为health_reports表添加字段可能已存在: {}", e.getMessage());
         }
         }
 
 
+
+        ensureColumn("health_reports", "subject_id", "BIGINT COMMENT '报告主体用户ID(关联users表,为null表示未绑定)'");
+
         // ---------- 健康指标表 新增symptoms字段 ----------
         // ---------- 健康指标表 新增symptoms字段 ----------
         try {
         try {
             jdbcTemplate.execute("ALTER TABLE health_indicators ADD COLUMN symptoms TEXT COMMENT '过量/缺乏相关症状描述'");
             jdbcTemplate.execute("ALTER TABLE health_indicators ADD COLUMN symptoms TEXT COMMENT '过量/缺乏相关症状描述'");