Skip to content

Please spell out what "references" does in @relation annotations #8202

Description

@tredondo

First day with Prisma, and I'm trying to learn relations.

I get it that in author User @relation(fields: [authorId], references: [id]), the references... field (is that the correct name) is supposed to tell Prisma that the authorId field references the id field in the User model. But it would be nice to spell that out, and discuss what other values the references array can take (and why it's not written as references: id (composite keys?)

I think that belongs in the [Annotated relation fields](https://www.prisma.io/docs/orm/v6/prisma-schema/data-model/relations#annotated-relation-fields) section, which talks about fields, but not about references.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions