Is it necessary to define both sides of a relation?

I'm looking at the docs and it is not clear whether I need to define both sides (eg: both one and many) of a relation when working with a Drizzle schema. I've just migrated my Prisma schema and I'm in the process of adding relations. If I have this for example:
export const OrgToTeam = relations(Organization, ({ many }) => ({
teams: many(Team),
}));
export const OrgToTeam = relations(Organization, ({ many }) => ({
teams: many(Team),
}));
do I also have to add:
export const TeamToOrg = relations(Team, ({ one }) => ({
org: one(Organization),
}));
export const TeamToOrg = relations(Team, ({ one }) => ({
org: one(Organization),
}));
if I want to join my Organizations when I query a Team?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server