AutoBE
    Preparing search index...

    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:

    • Generating correct Prisma relation syntax
    • Establishing bidirectional relationships between models
    • Enabling proper type-safe querying through Prisma client
    • Supporting complex relationship patterns (1:1, 1:N, M:N)
    interface IRelation {
        name: string & CamelPattern;
        targetModel: string;
    }
    Index

    Properties

    Properties

    name: string & CamelPattern

    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:

    • "customer" for shopping_customer_id field
    • "channel" for shopping_channel_id field
    • "parent" for parent_id field in hierarchical structures
    • "snapshot" for versioning relationships
    • "article" for bbs_article_id field

    Naming convention: camelCase, descriptive of the relationship's business meaning

    targetModel: string

    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:

    • "shopping_customers" for customer relationships
    • "shopping_channels" for channel relationships
    • "bbs_articles" for article relationships
    • "attachment_files" for file attachments

    The target model should exist in the same schema or be accessible through the Prisma schema configuration.