drizzle-orm-fk-omission-common-gotcha

Drizzle ORM supports foreign key references via .references() but developers frequently omit them, declaring relationship columns as plain int fields. This guarantees orphaned rows on any deletion. In the TaskFlow codebase, teamId, assigneeId, creatorId, taskId, authorId, and userId were all plain integers with no referential integrity enforced at the DB level. Always audit Drizzle schemas for missing .references() before shipping.