Rename User relation to author in Post model#7417
Rename User relation to author in Post model#7417martinmona wants to merge 3 commits intoprisma:mainfrom
Conversation
WalkthroughUpdated a Prisma schema example: in the Post model the relation and foreign-key field were renamed from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx (1)
116-116: Update field name reference in documentation text.The explanatory text references
userId, but the field has been renamed toauthorIdin the code example above.🔎 Proposed fix
-- If you delete a `Tag`, the corresponding tag assignment is also deleted in `TagOnPosts`, using the `Cascade` referential action -- If you delete a `User`, the author is removed from all posts by setting the field value to `Null`, because of the `SetNull` referential action. To allow this, `User` and `userId` must be optional fields in `Post`. +- If you delete a `User`, the author is removed from all posts by setting the field value to `Null`, because of the `SetNull` referential action. To allow this, `User` and `authorId` must be optional fields in `Post`.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.