Multi-Tenant Foreign Keys in PostgreSQL

Multi-Tenant Foreign Keys in PostgreSQL

A SaaS workspace imports a batch of tasks. One row carries workspace 10 and project 202. Both IDs exist, so the database accepts the row. But project 202 belongs to workspace 20. The import has created a task whose recorded owner and parent disagree. Multi-tenant...