© 2026 Hedgehog Software, LLC

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

SQL noob trying to make schema Drizzle ORM

My confusion comes from how to structure the database so that I don't save duplicate data and when I update I don't leave the data (like promoting agent to lead)

I have watched a lot of tutorials but I just can't seem to get the mental model on how to do this or even what would be the best way to do this.

where when a user logs in he is assigned a role
enum UserRole {
  SUPER = "super",
  ADMIN = "admin",
  HOD = "hod",
  MANAGER = "manager",
  LEAD = "lead",
  AGENT = "agent",
  USER = "user",
}
enum UserRole {
  SUPER = "super",
  ADMIN = "admin",
  HOD = "hod",
  MANAGER = "manager",
  LEAD = "lead",
  AGENT = "agent",
  USER = "user",
}


now those roles define what actions the user can perform.
- agent has one lead
- lead has one manager
- lead is in charge of one brand
- manager has one hod
- manager is in charge of multiple brands

The code is here
https://stackoverflow.com/questions/77560683/sql-noob-trying-to-make-schema-drizzle-orm
Stack Overflow
SQL noob trying to make schema Drizzle ORM
My confusion comes from how to structure the database so that I don't save duplicate data and when I update I don't leave the data (like promoting agent to lead)
I am designing my db structure for ...
SQL noob trying to make schema Drizzle ORM
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

noob help: INSERT with JOIN SQL to Drizzle
Drizzle TeamDTDrizzle Team / help
3y ago
Column name different in drizzle magic sql vs drizzle-orm
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle-kit push ignores SQL schema
Drizzle TeamDTDrizzle Team / help
8mo ago
Drizzle ORM issues
Drizzle TeamDTDrizzle Team / help
15mo ago