drizzle-orm-fk-not-enforced-by-default-causes-orphans
Drizzle ORM schemas will compile and run without foreign key constraints unless .references() is explicitly added to relational columns. The TaskFlow schema had teamId, assigneeId, creatorId, taskId, authorId, userId all as plain int with no FK — guaranteeing orphaned rows on any deletion. Always audit Drizzle schemas for missing .references() on every join column.
Related
- drizzle-orm-missing-foreign-keys-orphaned-rows
- drizzle-fk-references-omitted-by-default-causes-orphans
- drizzle-orm-fk-references-silently-omitted-causing-orphaned
- drizzle-orm-fk-references-commonly-omitted
- drizzle-orm-does-not-auto-enforce-foreign-keys
- drizzle-orm-fk-not-auto-applied-must-use-references
- drizzle-orm-foreign-keys-not-implicit
- drizzle-orm-fk-omission-common-gotcha
- drizzle-fk-constraints-not-automatic-must-use-references
- drizzle-orm-fk-omission-causes-orphaned-rows