php - Change architecture of User Table from old design to new -


i looking general information in regards user table design.

i have old table design 'users', need update not breaking entire site's structure.

current table design

userid | email   | firstname | last name | ... 1      | a@a.com | john      | doe       | ... 2      | b@b.com | jane      | doe       | ...  

i need able create "primary" users, "assitant" users.

now believe should have few tables designed:

  1. users
  2. accounts
  3. users > accounts - (relationships & permissions) ie: of users > accounts

tableid | userid | accountid | perm 1 | 1 | 1 | 001

so guess question is. there better way this? if there current design being used?

hope makes sense. direction in appreciated.

here's example you'd have table each group, plus users table. can filter users group using join. don't love this. if else has better suggestion, i'd hear it.

http://sqlfiddle.com/#!9/993dd/1


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

javascript - How to bind ViewModel Store to View? -

javascript - Solution fails to pass one test with large inputs? -