refactor: 删除 users 表中的冗余飞书字段

- 删除 feishu_user_id, feishu_open_id, tenant_key 字段
- JWT token 改用 feishu_app_id 代替 feishu_user_id
- 删除废弃的 FeishuService::sendApprovalMessage() 方法
- 更新 User 模型移除废弃字段和 scope 方法

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-26 16:33:58 +08:00
parent 0489da5e40
commit fdbe2e837a
4 changed files with 36 additions and 110 deletions
@@ -0,0 +1,32 @@
-- X-Server 删除 users 表中的冗余飞书字段
-- 这些字段的数据已迁移至 user_feishu_apps 表
USE xserver;
-- =====================================
-- 删除冗余的飞书字段
-- =====================================
-- 删除 feishu_user_id
ALTER TABLE users DROP COLUMN feishu_user_id;
-- 删除 feishu_open_id
ALTER TABLE users DROP COLUMN feishu_open_id;
-- 删除 tenant_key
ALTER TABLE users DROP COLUMN tenant_key;
-- =====================================
-- 验证结果
-- =====================================
SELECT "=== users 表结构验证 ===" as "";
DESCRIBE users;
SELECT "=== user_feishu_apps 表统计 ===" as "";
SELECT
company_id,
COUNT(DISTINCT user_id) as users_count,
COUNT(*) as bindings_count
FROM user_feishu_apps
GROUP BY company_id;