fix(delegate): generated fk fields shouldn't inherit @map attribute from its origin#1633
fix(delegate): generated fk fields shouldn't inherit @map attribute from its origin#1633
@map attribute from its origin#1633Conversation
… from its origin Fixes #1551
WalkthroughWalkthroughThe recent changes enhance the 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 Configuration 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 (2)
- packages/schema/src/plugins/prisma/schema-generator.ts (2 hunks)
- tests/regression/tests/issue-1551.test.ts (1 hunks)
Additional comments not posted (8)
tests/regression/tests/issue-1551.test.ts (6)
1-1: Import statement is correct.The import statement for
loadSchemais necessary for the test.
2-2: Test suite description is clear.The description of the
issue 1551test suite is clear and follows standard conventions.
3-3: Test case name is appropriate.The asynchronous test case is named
regression, indicating its purpose.
4-4: Usage ofawaitis correct.The
awaitkeyword is necessary for the asynchronous operation of loading the schema.
5-24: Schema definition is correct.The schema includes three models:
User,Profile, andIndividualProfile. It correctly sets up the relations and attributes to replicate the issue described in #1551.
25-26: Test closure is correct.The syntax for closing the asynchronous function and the test suite is correct.
packages/schema/src/plugins/prisma/schema-generator.ts (2)
445-448: Addition ofPrismaAttributeArgis correct.The new
PrismaAttributeArgfor the@relationattribute improves the clarity of the relation name.
491-493: Filtering of@mapattribute is correct.The filtering mechanism for the
@mapattribute from foreign key field attributes addresses the issue described in #1551.
Fixes #1551