drizzle-orm-foreign-keys-not-added-automatically
Drizzle ORM does not auto-generate foreign key constraints from column naming conventions. References must be explicitly declared with .references(() => table.column) on each column. Omitting this means integer columns like teamId, assigneeId, creatorId silently accept orphaned values — no DB-level integrity enforcement even though the ORM supports it. Any Drizzle schema audit should grep for bare int() columns that reference other tables but lack .references().
Related
- drizzle-orm-fk-references-must-be-explicit
- drizzle-orm-fk-not-implicit-must-use-references
- drizzle-orm-supports-fk-references-must-be-declared-explicit
- drizzle-orm-fk-references-must-be-explicit-no-auto-enforceme
- drizzle-fk-references-omitted-by-default-causes-orphans
- drizzle-orm-fk-omission-causes-orphaned-rows