|
@@ -6336,6 +6336,10 @@ try {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.warn("创建activity_materials表失败: {}", e.getMessage());
|
|
log.warn("创建activity_materials表失败: {}", e.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 迁移247: user_intents 表添加跳过次数和最近跳过时间(原迁移243误置于seedSysMenus中,菜单非空时永不执行)
|
|
|
|
|
+ ensureColumn("user_intents", "skip_count", "INT DEFAULT 0 COMMENT '跳过意图问卷次数'");
|
|
|
|
|
+ ensureColumn("user_intents", "last_skip_at", "DATETIME DEFAULT NULL COMMENT '最近一次跳过意图问卷时间'");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void runMigration82() {
|
|
private void runMigration82() {
|
|
@@ -8961,6 +8965,8 @@ private void runMigration100() {
|
|
|
"survey_template_id BIGINT DEFAULT NULL COMMENT '最近作答问卷模板ID', " +
|
|
"survey_template_id BIGINT DEFAULT NULL COMMENT '最近作答问卷模板ID', " +
|
|
|
"survey_submitted_at DATETIME DEFAULT NULL COMMENT '最近问卷提交时间', " +
|
|
"survey_submitted_at DATETIME DEFAULT NULL COMMENT '最近问卷提交时间', " +
|
|
|
"survey_result_json TEXT COMMENT '问卷答案→推荐结果快照', " +
|
|
"survey_result_json TEXT COMMENT '问卷答案→推荐结果快照', " +
|
|
|
|
|
+ "skip_count INT DEFAULT 0 COMMENT '跳过意图问卷次数', " +
|
|
|
|
|
+ "last_skip_at DATETIME DEFAULT NULL COMMENT '最近一次跳过意图问卷时间', " +
|
|
|
"created_at DATETIME DEFAULT CURRENT_TIMESTAMP, " +
|
|
"created_at DATETIME DEFAULT CURRENT_TIMESTAMP, " +
|
|
|
"updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, " +
|
|
"updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, " +
|
|
|
"UNIQUE KEY uk_user (user_id)" +
|
|
"UNIQUE KEY uk_user (user_id)" +
|
|
@@ -9346,20 +9352,5 @@ private void runMigration100() {
|
|
|
Long id = jdbcTemplate.queryForObject("SELECT LAST_INSERT_ID()", Long.class);
|
|
Long id = jdbcTemplate.queryForObject("SELECT LAST_INSERT_ID()", Long.class);
|
|
|
keyToId.put(m[1], id);
|
|
keyToId.put(m[1], id);
|
|
|
}
|
|
}
|
|
|
- // 迁移242: health_reports 表添加 payload_json 字段(报告完整载荷快照)
|
|
|
|
|
- try {
|
|
|
|
|
- jdbcTemplate.execute("ALTER TABLE health_reports ADD COLUMN payload_json LONGTEXT DEFAULT NULL COMMENT '报告完整载荷快照'");
|
|
|
|
|
- log.info("已添加payload_json列到health_reports表");
|
|
|
|
|
- } catch (Exception ex) {
|
|
|
|
|
- log.warn("添加payload_json列失败: {}", ex.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- // 迁移243: user_intents 表添加跳过次数和最近跳过时间
|
|
|
|
|
- try {
|
|
|
|
|
- jdbcTemplate.execute("ALTER TABLE user_intents ADD COLUMN skip_count INT DEFAULT 0 COMMENT '跳过意图问卷次数'");
|
|
|
|
|
- jdbcTemplate.execute("ALTER TABLE user_intents ADD COLUMN last_skip_at DATETIME DEFAULT NULL COMMENT '最近一次跳过意图问卷时间'");
|
|
|
|
|
- log.info("已添加skip_count和last_skip_at列到user_intents表");
|
|
|
|
|
- } catch (Exception ex) {
|
|
|
|
|
- log.warn("添加user_intents跳过列失败: {}", ex.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|