drizzle-orm-missing-foreign-keys-orphaned-rows

TaskFlow’s Drizzle schema defines all relational IDs (teamId, assigneeId, creatorId, taskId, authorId, userId) as plain int columns without .references() calls. Drizzle supports FK declarations natively but they were omitted, guaranteeing orphaned rows on any deletion. Always define .references() on every FK column in Drizzle schemas to enforce referential integrity at the DB layer.