Files
PaperClipAI/packages/db/src/migrations/0257_bizarre_the_hunter.sql
DottaandPaperclip 6abeb67334 feat: add opt-in chat provider and data foundation (#13100)
Add dormant provider contracts, qualified patched adapters, tenant-scoped persistence and lifecycle ownership without activating chat routes. Preserve the experimental integration as dependent PR #13038.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-09 13:49:12 -05:00

8 lines
976 B
SQL

DROP INDEX "chat_message_links_provider_message_uq";--> statement-breakpoint
CREATE UNIQUE INDEX "chat_endpoints_live_bot_external_uq" ON "chat_endpoints" USING btree ("provider","provider_account_id","bot_external_id") WHERE "chat_endpoints"."status" in ('verifying', 'active', 'paused', 'attention')
and "chat_endpoints"."provider_account_id" is not null
and "chat_endpoints"."bot_external_id" is not null;--> statement-breakpoint
CREATE UNIQUE INDEX "chat_endpoints_live_bot_username_uq" ON "chat_endpoints" USING btree ("provider","provider_account_id","bot_username") WHERE "chat_endpoints"."status" in ('verifying', 'active', 'paused', 'attention')
and "chat_endpoints"."provider_account_id" is not null
and "chat_endpoints"."bot_username" is not null;--> statement-breakpoint
CREATE UNIQUE INDEX "chat_message_links_provider_message_uq" ON "chat_message_links" USING btree ("endpoint_id","conversation_id","provider_message_id");