What problem does it solve?
Normalized data models often require manual, error-prone cascade deletions to maintain referential integrity. This Skill provides a deterministic approach to removing a conversation and all related data across junctions, messages, files, and dependent records, preventing orphaned data and inconsistent states.
Core Features & Use Cases
- Automatic cleanup: Deletes related records across junction tables (e.g., projectConversations, conversationParticipants) and dependent entities (messages, attachments, toolCalls, sources) when a parent is removed.
- Safe delete strategy: Applies a defined order (children → parents) and supports nullifying associations for reusability of files and memories.
- Configurable scope: Allows optional deletion of messages and/or the conversation and includes GDPR-like data disposal patterns for user data.
Quick Start
Invoke cascadeDeleteConversation(ctx, conversationId) within a mutation to cleanly remove a conversation and all related data. Use the function from packages/backend/convex/lib/utils/cascade.ts to ensure deterministic, index-backed lookups.