@martinbean Specially in SaaS application if I want to separate tenants account using single database for all tenants concept, should I use tenant_id foreign key column for all others migration or I should use tenant_id based on scenario? Where I might no need to use that relationship reference
@martinbean Yes. You are closed to my answer. I want to know should I avoid any model that may no need a belongs to relationship with tenant or its a best practice to keep relationship all other models with tenant?
Anything that's shared by all tennants doesn't need a tennant_id. Anything that is related to a model that is related to a tennant doesn't necessarily need a tennant_id, if it is not directly related to the tennant. You just need to make sure that private data is never accessed by those unauthorised to access it.