© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
8 replies
McPizza

Relationships: Self one-one & one-many

I have a table called convoMessages
Trying to add a self relation of one to one
But also a self relation of one to many

Drizzle Studio is throwing an error of
Error: There are multiple relations between "convoMessages" and "convo_messages". Please specify relation name
Error: There are multiple relations between "convoMessages" and "convo_messages". Please specify relation name


I would have thought this syntax is fine:
replies: many(convoMessages),
replyTo: one(convoMessages, {
fields: [convoMessages.replyToId],
references: [convoMessages.id]
}),
replies: many(convoMessages),
replyTo: one(convoMessages, {
fields: [convoMessages.replyToId],
references: [convoMessages.id]
}),
image.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

one-to-many self reference
Drizzle TeamDTDrizzle Team / help
2y ago
one-to-many self-relation
Drizzle TeamDTDrizzle Team / help
2y ago
One to Many Self Relations...
Drizzle TeamDTDrizzle Team / help
3y ago
How to insert many rows with one-to-many relationships
Drizzle TeamDTDrizzle Team / help
3y ago