Commit Graph
11 Commits
Author SHA1 Message Date
richjohnrambo 14ee3d937f fix: order workbench modules 2026-09-10 15:19:29 +08:00
richjohnrambo bf562c7d56 feat: migrate IM identity and snowflake primary keys 2026-08-18 01:15:21 +08:00
richjohnrambo f2c229135b feat: complete IM P0 and P1 reliability work 2026-08-17 13:43:27 +08:00
richjohnrambo ddf0f7a55e feat: persist group business state in tables 2026-08-17 09:50:31 +08:00
richjohnrambo d8d1639d5b fix mysql tenant database schema cleanup 2026-08-15 15:48:17 +08:00
Your Name a7c5bc9bbd 修复登录500: auth/credentials表缺少tenant_id列
登录时报 Error 1054: Unknown column 'tenant_id' in 'where clause'。

根因:CreateDb里auth/credentials的建表语句从未定义过tenant_id列——这不是
版本跳过导致的迁移遗漏,而是即便全新安装也会触发的建表语句本身的缺陷,
因为查询代码(AuthAddRecord/AuthGetUniqueRecord等)一直在无条件地按
tenant_id过滤/写入这两张表。

同时migration脚本里的dropTenantIDColumns此前会把auth/credentials的
tenant_id也当成"新增多租户特性表的遗留列"一并删掉,跟前面加的列直接打架。

修复:
- adapter.go: CreateDb的auth/credentials建表语句补上tenant_id列,
  修正未来全新安装的根源问题
- apply_hotgo_tenant_db.go: 补上ALTER TABLE ADD COLUMN(现有数据回填到
  默认租户id=1);dropTenantIDColumns排除auth/credentials,不再误删
2026-08-15 14:35:02 +08:00
Your Name b01ed29751 修复迁移脚本: 补全CreateDb版本跳过导致缺失的表
CreateDb的多个建表函数(createTenantRegistry/createIMSecurityTables/
createIMNotificationTables/createIMRelationTables)只在全新库的建表路径里
调用;UpgradeDb对已存在且版本号已达标的库直接判定"无需升级"直接跳过,
不会补建任何表。我们这个tinode库版本号刚好已经等于目标版本,所以这几个
函数从未真正执行过。

补上迁移脚本里缺失的表(与adapter.go里的建表语句保持一致):
tinode.im_tenant / im_tenant_config (原脚本假设已存在,直接ALTER导致报错)
tinode.im_realname_verifications / im_action_tokens
tinode.im_system_notifications
tinode.im_friend_requests / im_friendships / im_user_blocks / im_favorites
2026-08-15 14:17:53 +08:00
richjohnrambo 170bbdca76 feat: add safety reporting APIs 2026-08-14 00:01:54 +08:00
richjohnrambo fa75c0f0f9 feat: add workbench and client settings APIs 2026-08-13 23:43:24 +08:00
richjohnrambo dfcccbb761 feat: add chapter eight call records 2026-08-13 16:14:57 +08:00
richjohnrambo 31f82d9c41 feat: add im tenant db routing and chapter seven flows 2026-08-13 11:30:48 +08:00