drizzle-orm-foreign-key-omission-causes-orphaned-rows
In Drizzle ORM, integer foreign key columns (teamId, assigneeId, creatorId, etc.) defined as plain int without .references() have no referential integrity enforcement. Deletions will silently create orphaned rows with no database-level protection. Always explicitly wire .references(() => table.id) on every FK column in Drizzle schemas — the ORM supports it but does not default to it.