I have 5 tables in my database. These are users, staffs, customers, managers, manager_members.
The users table only contains the account information: id, username, password, last_login, status.
The manager_members contains the id and position of a manager.
The staffs and customers tables contain the general information of user: name, age, gender, etc. These 2 tables also contain another column name user_id.
The managers table contain general information of the manager: name, age, gender, etc. It also contains 2 columns user_id and manager_member_id.
My question is I am doing the right job of creating the database with the foreign keys?
I just bake my models whenever I create a table.
So far what I see are:
- Users hasMany Manager, Staff, Customers
- Manager belongsTo User, Manager belongsTo ManagerMember
- Staff belongsTo User
- Customer belongsTo User
- ManagerMember hasMany Manager
Not sure if number 5 is correct.