Skip to content

Conversation

@Kinbaum
Copy link

@Kinbaum Kinbaum commented Dec 2, 2025

Summary

This PR implements the necessary changes to handle foreign key relationships between the ChatSessions table and its dependent tables ConversationMessages and WorkingMemory. This is useful if a user wants to delete a chat, we can perform a cascading deletion as defined in our schema. The FK constraint is entirely opt-in, but certain order of operations needed to change.

Code changes

  • Modified saveConversation() method: Ensures the chat session row is created/updated before saving messages to prevent FK constraint violations.

Impact

  • None. Users who want FK constraints can opt-in and run their own migrations
  • No breaking changes to API or application logic

@vercel
Copy link

vercel bot commented Dec 2, 2025

@Kinbaum is attempting to deploy a commit to the Pontus Abrahamsson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Kinbaum
Copy link
Author

Kinbaum commented Dec 9, 2025

@pontusab Can I get your review on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant