export const authorsRelations = relations(authors, ({ one, many }) => ({
authorsToPapers: many(authorsToPapers),
}));
export const papersRelations = relations(papers, ({ many }) => ({
authorsToPapers: many(authorsToPapers),
}));
export const authorsToPapersRelations = relations(
authorsToPapers,
({ one }) => ({
author: one(authors, {
fields: [authorsToPapers.authorId],
references: [authors.authorId],
}),
paper: one(papers, {
fields: [authorsToPapers.paperId],
references: [papers.paperId],
}),
}),
);
export const authorsRelations = relations(authors, ({ one, many }) => ({
authorsToPapers: many(authorsToPapers),
}));
export const papersRelations = relations(papers, ({ many }) => ({
authorsToPapers: many(authorsToPapers),
}));
export const authorsToPapersRelations = relations(
authorsToPapers,
({ one }) => ({
author: one(authors, {
fields: [authorsToPapers.authorId],
references: [authors.authorId],
}),
paper: one(papers, {
fields: [authorsToPapers.paperId],
references: [papers.paperId],
}),
}),
);