ai-chatbot/lib/db/migrations/0024_add_dingtalk_userid.sql
Your Name 7a4fa8e1d8
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
添加钉钉集成、精选作品和排行榜功能
2025-12-18 15:12:34 +08:00

13 lines
508 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 迁移文件:0024_add_dingtalk_userid.sql
-- 功能:添加钉钉用户ID字段,支持批量同步用户信息
-- 添加钉钉用户ID字段
ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "dingtalkUserId" varchar(128) DEFAULT NULL;
-- 添加索引加速查询
CREATE INDEX IF NOT EXISTS "idx_user_dingtalk_userid" ON "User"("dingtalkUserId") WHERE "dingtalkUserId" IS NOT NULL;
-- 添加注释
COMMENT ON COLUMN "User"."dingtalkUserId" IS '钉钉用户ID,用于调用钉钉API获取用户信息';