© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
DT
Drizzle Team
•
2y ago
•
1 reply
Nelson Sousa
How to reference the same table in the table's definition?
I am defining this table
menuItem
menuItem
and I want this table to support multi
-levels
, so I am adding a
parentId
parentId
column that should reference this own column
id
id
. How should I do it with Drizzle ORM
?
My attempt failed with a TypeScript error
, as you can see in the printscreen
. I am using postgres
, if that matters
.
Thank you
!
Drizzle Team
Join
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Reference the same table
DT
Drizzle Team / help
2y ago
Circular Reference Error when Using Self-Reference in Table Definition with Drizzle-ORM
DT
Drizzle Team / help
2y ago
Get table definition?
DT
Drizzle Team / help
2y ago
relations to the same table
DT
Drizzle Team / help
2y ago