Name of the relation property in the Prisma model.
This becomes the property name used to access the related model instance through the Prisma client. Should be descriptive and reflect the business relationship being modeled.
Examples:
Naming convention: camelCase, descriptive of the relationship's business meaning
Name of the inverse relation property that will be generated in the target model.
In Prisma's bidirectional relationships, both sides need relation
properties. While name defines the property in the current model
(the one with the foreign key), oppositeName defines the property that
will be generated in the target model for back-reference.
For 1:N relationships, the target model's property will be an array type. For 1:1 relationships (when the foreign key has unique constraint), it will be a singular reference.
Examples (when this FK is defined in bbs_article_comments model):
comment.article accesses the parent articlearticle.comments accesses child commentsMore examples:
users model to access user_sessions[]bbs_articles model to access bbs_article_snapshots[]parent relationNaming convention: camelCase, typically plural for 1:N relationships, singular for 1:1 relationships.
Name of the target model being referenced by this relation.
Must exactly match an existing model name in the schema. This is used by Prisma to establish the foreign key constraint and generate the appropriate relation mapping.
Examples:
The target model should exist in the same schema or be accessible through the Prisma schema configuration.
Interface representing a Prisma relation configuration between models.
This interface defines how foreign key fields establish relationships with their target models. It provides the necessary information for Prisma to generate appropriate relation directives (@relation) in the schema, enabling proper relational data modeling and ORM functionality.
The relation configuration is essential for: