export const comments = pgTable('comments', {
id: uuid('id').primaryKey().defaultRandom().unique().notNull(),
parentId: uuid('parent_id').references(() => comments.id),
export const commentsRelations = relations(comments, ({ one }) => ({
parent: one(comments, {
fields: [comments.parentId],
references: [comments.id],
}),
}));
export type Comment = InferModel<typeof comments>;
export const comments = pgTable('comments', {
id: uuid('id').primaryKey().defaultRandom().unique().notNull(),
parentId: uuid('parent_id').references(() => comments.id),
export const commentsRelations = relations(comments, ({ one }) => ({
parent: one(comments, {
fields: [comments.parentId],
references: [comments.id],
}),
}));
export type Comment = InferModel<typeof comments>;