我试图从文档中更好地理解 Prisma ORM 中的关系:
model User {
id Int @id @default(autoincrement())
posts Post[]
profile Profile?
}
model Profile {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id]) // this references the id field in User model??
userId Int @unique // relation scalar field (used in the `@relation` attribute above)
}
user User @relation(fields: [userId], references: [id]
中的[id]
[id] 是否引用了用户模型中的 id 字段??