Files
multica/server/migrations/259_issue_origin_dingtalk_chat.down.sql
YYClaw c3577cb04b feat(dingtalk): add DingTalk bot integration (MUL-3958) (#4829)
Adds a DingTalk (钉钉) bot integration on the bring-your-own-app model: a
workspace admin creates their own Stream-mode robot and pastes its AppKey /
AppSecret, so no public webhook or OAuth redirect is required. Each agent gets
its own bot identity, so several agents can be distinct, separately
@-mentionable contacts in one DingTalk organization.

Supports DMs, @-mentions in groups, inbound images, /issue quick-create, and
/new. Built on the shared channel engine (ForceFresh/BareFresh, MediaResolver /
MediaRef and the intent ledger) rather than a private implementation.

Off unless MULTICA_DINGTALK_SECRET_KEY is set. Docs in en/zh/ja/ko.

Closes #4791.

Community-maintained: @yyclaw is the code owner for
server/internal/integrations/dingtalk/.
2026-08-06 15:36:02 +08:00

16 lines
978 B
SQL

-- Revert to the pre-DingTalk origin list. Existing dingtalk_chat rows must be
-- deleted or relabeled before this rollback can succeed.
--
-- The down path deliberately VALIDATEs in this same file, unlike the up path.
-- Narrowing a CHECK can genuinely be violated by existing data, so this must
-- fail closed while dingtalk_chat rows remain rather than silently leaving
-- rows the constraint forbids. That means accepting the ACCESS EXCLUSIVE lock
-- for the scan — an acceptable trade for an operator-driven rollback, which is
-- rare and supervised, where a silently untrusted constraint would be worse.
-- Same reasoning as 249_issue_subscriber_delegated.down.sql.
ALTER TABLE issue DROP CONSTRAINT IF EXISTS issue_origin_type_check;
ALTER TABLE issue ADD CONSTRAINT issue_origin_type_check
CHECK (origin_type IN ('autopilot', 'quick_create', 'lark_chat', 'slack_chat', 'agent_create'))
NOT VALID;
ALTER TABLE issue VALIDATE CONSTRAINT issue_origin_type_check;