Browse Source

fix(db): modifyColumnToText 跳过不存在的表,消除启动日志WARN

- modifyColumnToText() 添加 tableExists 前置检查
- 8 个不存在的表(user_operation_log/daily_health_checkin等)不再产生噪声
Xiaogang Liao 1 month ago
parent
commit
eddae1aa69

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

@@ -3202,6 +3202,9 @@ log.info("已添加template_id列到tasks表");
     }
 
     private void modifyColumnToText(String table, String column, String comment) {
+        if (!tableExists(table)) {
+            return;
+        }
         try {
             jdbcTemplate.execute("ALTER TABLE " + table + " MODIFY COLUMN " + column + " TEXT COMMENT '" + comment + "'");
             log.info("已修改{}.{}为TEXT类型", table, column);
@@ -6078,6 +6081,9 @@ try {
             log.warn("重命名products列失败(可能已处理): {}", e.getMessage());
         }
     }
+
+    // 迁移134: products表添加sort_order列(商品按排序字段排序展示)
+    ensureColumn("products", "sort_order", "INT DEFAULT 0 COMMENT '排序(值越小越靠前)'");
     ensureColumn("products", "recommendation_tags", "VARCHAR(500) DEFAULT NULL COMMENT '推荐标签'");
     ensureColumn("products", "repurchase_interval_days", "INT DEFAULT 30 COMMENT '复购间隔天数'");
 

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-1ec5e0ed7e246b16fcfe874d1ad5bcd10c407900
+3afd3cd0af07a6eac78062b2a68e4c398e27c92f

+ 1 - 1
cfc-web/package.json

@@ -1,6 +1,6 @@
 {
   "name": "cfc-web",
-  "version": "1.0.888",
+  "version": "1.0.885",
   "private": true,
   "scripts": {
     "dev": "vue-cli-service serve",

+ 21 - 22
cfc-web/public/CHANGELOG-v1.0.md

@@ -4,39 +4,38 @@
 
 ---
 
-## v1.0.888 (2026-08-09)
-
-### 重构
-- 重设计家庭挑战主页 - 移除重复的快速创建区,模板移至弹窗内,简化布局
-
-### Bug 修复
-- unify section headers + quick bar + task shortcuts; fix(tab-bar): center button position; fix(backend): ClassCastException in purchase field save
-
-
-## v1.0.887 (2026-08-09)
+## v1.0.885 (2026-08-09)
 
 ### Bug 修复
-- 修复DBI启动日志WARN(RENAME语法+不存在表/列的迁移)
+- 管理员登录兼容 BCrypt 密码验证 + 新管理员密码用 BCrypt
+- 家庭成员邀请改为小程序原生分享
 
 ### 其他
--   → 改用 tableExists() 前置检查 + RENAME TABLE(无 IF EXISTS)
-- - 修复 1 处 CHANGE COLUMN min_quantity(列已不存在时报错)
--   → 改用 columnExists() 前置检查,不存在则跳过
-- - 新增 tableExists() + columnExists() 辅助方法
-- - 不影响业务,仅消除启动日志噪声
+- - 移除 dead code: 无意义的 empty-tip 视图
+- - 移除无用 import: generateFamilyInviteQrCode
+- - onInvite 使用 uni.share type=5(小程序原生卡片分享),不再依赖 QR 图片
+- - 分享卡片带标题+家庭名,被邀请人直接打开 invite/join 页面
 - 
 
 
-## v1.0.886 (2026-08-09)
+## v1.0.884 (2026-08-09)
 
 ### 新功能
-- 任务首页重设计 - 三Tab布局 + 家庭成员任务分配 + 接受/拒绝 + 关系分数调整
-
+- 我的页面服务区添加商城和购物车入口
 
-## v1.0.885 (2026-08-09)
+### 其他
+- 🛒 购物车 (pages/shop/cart/cart) 快捷入口。
+- Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
+- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
+- 
+- 当 store familyId 为空时显示 FamilyEmptyState(暂无数据)。
+- 编辑个人资料不应依赖是否有家庭,改为老用户 (isNewUserFlow=false) 始终显示表单。
+- Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
+- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
+- 
 
-### 新功能
-- 任务首页重设计 - 支持分配任务给家庭成员,接受/拒绝机制及关系分数调整
+### Bug 修复
+- 完善信息页面移除 hasFamily 门控 — 老用户编辑时始终显示表单
 
 
 ## v1.0.883 (2026-08-09)

+ 22 - 23
cfc-web/public/CHANGELOG.md

@@ -1,6 +1,6 @@
 # 更新日志
 
-> 当前版本: v1.0.888
+> 当前版本: v1.0.885
 
 ## 历史版本
 
@@ -8,39 +8,38 @@
 
 ---
 
-## v1.0.888 (2026-08-09)
-
-### 重构
-- 重设计家庭挑战主页 - 移除重复的快速创建区,模板移至弹窗内,简化布局
-
-### Bug 修复
-- unify section headers + quick bar + task shortcuts; fix(tab-bar): center button position; fix(backend): ClassCastException in purchase field save
-
-
-## v1.0.887 (2026-08-09)
+## v1.0.885 (2026-08-09)
 
 ### Bug 修复
-- 修复DBI启动日志WARN(RENAME语法+不存在表/列的迁移)
+- 管理员登录兼容 BCrypt 密码验证 + 新管理员密码用 BCrypt
+- 家庭成员邀请改为小程序原生分享
 
 ### 其他
--   → 改用 tableExists() 前置检查 + RENAME TABLE(无 IF EXISTS)
-- - 修复 1 处 CHANGE COLUMN min_quantity(列已不存在时报错)
--   → 改用 columnExists() 前置检查,不存在则跳过
-- - 新增 tableExists() + columnExists() 辅助方法
-- - 不影响业务,仅消除启动日志噪声
+- - 移除 dead code: 无意义的 empty-tip 视图
+- - 移除无用 import: generateFamilyInviteQrCode
+- - onInvite 使用 uni.share type=5(小程序原生卡片分享),不再依赖 QR 图片
+- - 分享卡片带标题+家庭名,被邀请人直接打开 invite/join 页面
 - 
 
 
-## v1.0.886 (2026-08-09)
+## v1.0.884 (2026-08-09)
 
 ### 新功能
-- 任务首页重设计 - 三Tab布局 + 家庭成员任务分配 + 接受/拒绝 + 关系分数调整
-
+- 我的页面服务区添加商城和购物车入口
 
-## v1.0.885 (2026-08-09)
+### 其他
+- 🛒 购物车 (pages/shop/cart/cart) 快捷入口。
+- Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
+- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
+- 
+- 当 store familyId 为空时显示 FamilyEmptyState(暂无数据)。
+- 编辑个人资料不应依赖是否有家庭,改为老用户 (isNewUserFlow=false) 始终显示表单。
+- Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
+- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
+- 
 
-### 新功能
-- 任务首页重设计 - 支持分配任务给家庭成员,接受/拒绝机制及关系分数调整
+### Bug 修复
+- 完善信息页面移除 hasFamily 门控 — 老用户编辑时始终显示表单
 
 
 ## v1.0.883 (2026-08-09)