Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit a42f9e6

Browse files
authored
Add One-to-Many Relationship with Definitions and Example Sentences (#12)
* add one to many relationship between definition and sentences * change variable name to not match type name * change sentence to example to match odict repo
1 parent a7008c8 commit a42f9e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

prisma/schema.prisma

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,20 @@ model Definition {
8080
text String
8181
usageID BigInt?
8282
groupID BigInt?
83+
examples Example[]
8384
8485
Group Group? @relation(fields: [groupID], references: [id])
8586
Usage Usage? @relation(fields: [usageID], references: [id])
8687
8788
@@map("definitions")
8889
}
8990

90-
model Sentences {
91+
model Example {
9192
id BigInt @id @default(autoincrement()) @db.BigInt
9293
text String
94+
definitionID BigInt
9395
94-
@@map("sentences")
96+
definition Definition @relation(fields: [definitionID], references: [id])
97+
98+
@@map("examples")
9599
}

0 commit comments

Comments
 (0)