Help in deciding best way to link tables


#1

Hi there,

I am using CakePHP version 3.7. I have a users table. Each user can create many sites on the system that I am building. And each site will have its own users. So, I have the following tables: users(id), sites(id,user_id), sites_users(id, locked, site_id, user_id, role_id).

My question is this: To identify the creator of the site (who is also the admin), should I also have the user_id inside the sites table or is that not needed since that information can be stored inside the sites_users linking table?

I hope someone on here can help.


#2

Seems redundant to me. I’d just use the data from sites_users to manage that.