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 -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -