|
@@ -2934,6 +2934,24 @@ log.info("已添加template_id列到tasks表");
|
|
|
ensureColumn("family_challenge", "target_mode", "VARCHAR(20) DEFAULT 'aggregate' COMMENT '目标模式: aggregate=集体总合/all_members=全员个人目标'");
|
|
ensureColumn("family_challenge", "target_mode", "VARCHAR(20) DEFAULT 'aggregate' COMMENT '目标模式: aggregate=集体总合/all_members=全员个人目标'");
|
|
|
ensureColumn("family_challenge", "target_value", "INT DEFAULT 0 COMMENT '目标值(aggregate=家庭合计值, all_members=每人目标值)'");
|
|
ensureColumn("family_challenge", "target_value", "INT DEFAULT 0 COMMENT '目标值(aggregate=家庭合计值, all_members=每人目标值)'");
|
|
|
|
|
|
|
|
|
|
+ // 迁移248: 创建 health_report_edit_logs 表(健康报告修改留痕,原迁移222误置于initializeDefaultData中仅测试环境执行)
|
|
|
|
|
+ try {
|
|
|
|
|
+ jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS health_report_edit_logs (" +
|
|
|
|
|
+ "id BIGINT AUTO_INCREMENT PRIMARY KEY, " +
|
|
|
|
|
+ "report_id BIGINT NOT NULL, " +
|
|
|
|
|
+ "user_id BIGINT, " +
|
|
|
|
|
+ "report_type VARCHAR(32), " +
|
|
|
|
|
+ "action VARCHAR(20) COMMENT 'create/edit', " +
|
|
|
|
|
+ "before_payload LONGTEXT, " +
|
|
|
|
|
+ "after_payload LONGTEXT, " +
|
|
|
|
|
+ "created_at DATETIME DEFAULT CURRENT_TIMESTAMP, " +
|
|
|
|
|
+ "INDEX idx_report_id (report_id)" +
|
|
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康报告修改留痕'");
|
|
|
|
|
+ log.info("已创建health_report_edit_logs表");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ // 表已存在,忽略错误
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
log.info("数据库迁移完成");
|
|
log.info("数据库迁移完成");
|
|
|
|
|
|
|
|
// ==================== 健康维度 Phase 1: health_dimension_score / health_data_source_record / health_norm_reference ====================
|
|
// ==================== 健康维度 Phase 1: health_dimension_score / health_data_source_record / health_norm_reference ====================
|
|
@@ -4148,21 +4166,6 @@ try {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
// 列已存在,忽略错误
|
|
// 列已存在,忽略错误
|
|
|
}
|
|
}
|
|
|
- try {
|
|
|
|
|
- jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS health_report_edit_logs (" +
|
|
|
|
|
- "id BIGINT AUTO_INCREMENT PRIMARY KEY, " +
|
|
|
|
|
- "report_id BIGINT NOT NULL, " +
|
|
|
|
|
- "user_id BIGINT, " +
|
|
|
|
|
- "report_type VARCHAR(32), " +
|
|
|
|
|
- "action VARCHAR(20) COMMENT 'create/edit', " +
|
|
|
|
|
- "before_payload LONGTEXT, " +
|
|
|
|
|
- "after_payload LONGTEXT, " +
|
|
|
|
|
- "created_at DATETIME DEFAULT CURRENT_TIMESTAMP" +
|
|
|
|
|
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康报告修改留痕'");
|
|
|
|
|
- log.info("已创建health_report_edit_logs表");
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- // 表已存在,忽略错误
|
|
|
|
|
- }
|
|
|
|
|
ensureColumn("product_orders", "supply_system_id", "BIGINT COMMENT '所属供应商体系ID'");
|
|
ensureColumn("product_orders", "supply_system_id", "BIGINT COMMENT '所属供应商体系ID'");
|
|
|
ensureColumn("product_orders", "supplier_id", "BIGINT COMMENT '收款供应商用户ID'");
|
|
ensureColumn("product_orders", "supplier_id", "BIGINT COMMENT '收款供应商用户ID'");
|
|
|
ensureColumn("product_orders", "supply_commission", "INT COMMENT '销售佣金(分)'");
|
|
ensureColumn("product_orders", "supply_commission", "INT COMMENT '销售佣金(分)'");
|