arafays
DTDrizzle Team
•Created by arafays on 12/28/2023 in #help
Union of schema with relations
This is code for my 2 tables where I am creating a new role and the adding its permissions
How would I make an insert schema for it so that the
name
from roles
table is added to the insert schema and used as the role
feild in rolePermissions
3 replies
DTDrizzle Team
•Created by arafays on 11/28/2023 in #help
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
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
10 replies