Hacker News new | ask | show | jobs
by DanHulton 577 days ago
Then said row is actually owned by nobody, and the problem solves itself. Your many-to-many table will have a row for each connection, and those rows will have a tenant_id. But that's a normal database problem that will essentially always require joins, at that point -- it's not complicated by this approach.

(Alternatively, your row might have two tenant IDs embedded directly in it by the nature of the shared connection, like "owner_id" and "renter_id" for a property, for example, and again, you're fine because you can use those IDs for a query very easily.)