Files
PaperClipAI/packages/db/src/schema/chat_telegram_draft_ids.ts
T
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

15 lines
544 B
TypeScript

import { pgSequence } from "drizzle-orm/pg-core";
// Telegram Stop updates contain a draft ID but no actor or generation. This
// content-free instance sequence must survive endpoint/company deletion and
// transaction rollback, so an old Stop can never name a newly allocated draft.
// Do not attach it to a table or cycle/reset it when clearing chat records.
export const chatTelegramDraftIds = pgSequence("chat_telegram_draft_ids", {
startWith: 1,
minValue: 1,
maxValue: 2_147_483_647,
increment: 1,
cache: 1,
cycle: false,
});