drizzle-fk-constraints-not-automatic-must-use-references

Drizzle ORM does not enforce foreign key constraints by default. Plain int columns for relational IDs (teamId, assigneeId, creatorId, authorId) will accept orphaned values at insertion with no DB-level rejection. Referential integrity requires explicit .references(() => table.id) on every FK column — without it, orphaned rows accumulate at the first deletion. The original TaskFlow schema had zero .references() calls on seven FK columns.