-
-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Description
Support the below schema:
model User {
id Int @id @default(autoincrement())
// posts Post[]. no need to specify it in Zmodel, ZenStack will generate it in the schema.prisma file.
}
model Post {
id Int @id @default(autoincrement())
author User @relation(fields: [authorId], references: [id])
authorId Int
}
Need naming convention rule to generate the inversed relation. Also, need a way to distinguish between one-to-one and one-to-many.
Take a reference of how EF handles it:
https://learn.microsoft.com/en-us/ef/core/modeling/relationships/one-to-one#one-to-one-without-navigation-to-dependent
jmarbutt and DawidWraga
Metadata
Metadata
Assignees
Labels
No labels