drizzle-fk-references-omitted-by-default-causes-orphans

Drizzle ORM supports foreign key constraints via .references() on column definitions, but they are not added automatically. The TaskFlow schema had all relational columns (teamId, assigneeId, creatorId, etc.) as plain int with no .references(), guaranteeing orphaned rows on any deletion. Always explicitly add .references(() => table.col, { onDelete: 'cascade' }) for relational integrity.