gneiru
gneiru
DTDrizzle Team
Created by PatrickVM on 2/13/2024 in #help
Creating One-to-Many relations
When using many, you won't need fields and references. Just many(suggestionsTable) is enough, then might also wanna add relations for suggestions table export const suggestionsRelations = relations(suggestionsTable, ({ one }) => ({ user: one(usersTable, { fields: [suggestionsTable.userId], references: [usersTable.id], }), })); Docs
3 replies