Skip to content

Conversation

oscartbeaumont
Copy link
Member

@oscartbeaumont oscartbeaumont commented Oct 1, 2025

Our previous definitions of nanoId and encryptedText in our database schema use Typescript to mark them as being required fields, but in practice that constrain isn't being enforced in the actual SQL DB schema. This means the types are lying. I was about to check and we have a non-insignificant amount of records which break these constrains which would be resulting in runtime errors for users trying to use Cap.

This PR updates the Drizzle schema to enforce these constrains and also relaxes the Typescript type on some fields to align with the reliability of the data in the database.

Blockers:

Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enforce-nullable-constrains

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

await db().insert(notifications).values({
id: notificationId,
orgId: recipientUser.activeOrganizationId,
orgId: undefined, // TODO: BRUHHHHH: recipientUser.activeOrganizationId,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dis needs fixing

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