fix(delegate): entity create fails when inheriting from a delegate model that extends an abstract model#1561
fix(delegate): entity create fails when inheriting from a delegate model that extends an abstract model#1561
Conversation
…del that extends an abstract model
WalkthroughWalkthroughThe recent changes introduce a function named Changes
Sequence Diagram(s)No applicable sequence diagrams are needed for these documentation-only changes. Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- packages/schema/src/plugins/prisma/schema-generator.ts (2 hunks)
- packages/sdk/src/model-meta-generator.ts (2 hunks)
- packages/sdk/src/utils.ts (1 hunks)
- tests/regression/tests/issue-1560.test.ts (1 hunks)
Additional comments not posted (6)
tests/regression/tests/issue-1560.test.ts (1)
1-41: LGTM! The test case is thorough and well-structured.The test case correctly addresses the issue by loading the schema, enhancing it, and performing data creation steps to verify the fix.
packages/sdk/src/model-meta-generator.ts (2)
270-273: LGTM! The integration ofgetInheritedFromDelegateis logical and correctly placed.The condition to exclude inherited fields from delegates, except for ID fields, is appropriate.
Line range hint
561-571:
LGTM! ThegetInheritedFromDelegatefunction is well-defined and correctly identifies the original delegate base model.The use of
findLastto start from the uppermost base is appropriate.packages/sdk/src/utils.ts (1)
561-571: LGTM! ThegetInheritedFromDelegatefunction is well-defined and correctly identifies the original delegate base model.The use of
findLastto start from the uppermost base is appropriate.packages/schema/src/plugins/prisma/schema-generator.ts (2)
265-268: LGTM! The integration ofgetInheritedFromDelegateis logical and correctly placed.The condition to exclude inherited fields from delegates, except for ID fields, is appropriate.
42-42: LGTM! ThegetInheritedFromDelegatefunction is well-defined and correctly identifies the original delegate base model.The use of
findLastto start from the uppermost base is appropriate.
Fixes #1560