relations to the same table

Is this not possible to do?
export const CompaniesRelations = relations(Companies, ({ many, one }) => ({
  clients: many(Companies),
  parentCompany: one(Companies, {
    fields: [Companies.parentCompanyId],
    references: [Companies.id],
  }),
  websites: many(Websites),
}));


I get an error when rinning the studio:
Error: There are multiple relations between "__public__.Companies" and "companies". Please specify relation name
this error disappears if i remove the self referential relations
Was this page helpful?