Cap icon indicating copy to clipboard operation
Cap copied to clipboard

Enforce nullable constraints

Open oscartbeaumont opened this issue 3 months ago • 1 comments

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:

  • [x] We need #1066 merged and orgId to be required on videos
  • [ ] Figure out notifications

oscartbeaumont avatar Oct 01 '25 05:10 oscartbeaumont

[!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.

coderabbitai[bot] avatar Oct 01 '25 05:10 coderabbitai[bot]