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().