lovart3/lib/db/migrations/0024_add_dingtalk_userid.sql

13 lines
508 B
SQL
Raw Permalink 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获取用户信息';