I am working on an application that allows users to manage their hosting accounts. At the moment, the database is just a users table and a hostingaccounts table. However, I do not know what is the best approach to link these to tables together.
Should the users table have a column named “owned_accounts” where the data is inserted like “5,18,28” and then split it in the application? What suggestions do you have?
if only one user can be the owner of a hosting account, use a foreign key on hostingaccounts like ownerid.
if your hosting account can be owned by multiple users, add an extra table like hostingaccountsownerships with ownershipid, userid, hostingaccountid and fetch from there.