© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
Night

How to do this in drizzle schema?

I moved from PrismaORM convert this model schema to drizzleSchema (nested self)
How to do that?

model Category {
  id       Int        @id @default(autoincrement())
  name     String
  parentId Int?
  parent   Category?  @relation("ParentChild", fields: [parentId], references: [id])
  children Category[] @relation("ParentChild")
  Product  Product[]
}
model Category {
  id       Int        @id @default(autoincrement())
  name     String
  parentId Int?
  parent   Category?  @relation("ParentChild", fields: [parentId], references: [id])
  children Category[] @relation("ParentChild")
  Product  Product[]
}
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

How to share Drizzle schema in multiple projects?
Drizzle TeamDTDrizzle Team / help
2y ago
how to model this query in drizzle
Drizzle TeamDTDrizzle Team / help
12mo ago
How to express this query in Drizzle?
Drizzle TeamDTDrizzle Team / help
3y ago
Password hashing in Drizzle schema
Drizzle TeamDTDrizzle Team / help
2y ago