While I've made progress in my journey to learn node-express + mysql + sequelize since day 0, I still find myself questioning if I'm on the right path.
In designing User role models, each user is associated with only one role model.
Some questions that arise are:
Do I need to create a separate sequelize model file for each table?
I came across the concept of normalizing database tables. Should I avoid adding a 'role_id' column in my Users table and consider creating a new table instead?
My scheme design includes the following tables (not entirely sure if this is the correct term, but I created a visual representation using ):
- Users table
- Roles table
- UserRoles table
USERS contains id(pk), full_name, email.
ROLES contains id(pk), description, user_id(foreign key????)
USERROLES contains id(pk), user_id, role_id