export const Comment = pgTable(
"comments",
{
id: serial("id").primaryKey(),
content: text("content").notNull(),
postId: integer("post_id").references(() => Post.id),
authorId: integer("author_id").references(() => Profile.id),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at").notNull().defaultNow(),
replyToId: integer("reply_to_id").references(() => Comment.id),
}}
);
export const Comment = pgTable(
"comments",
{
id: serial("id").primaryKey(),
content: text("content").notNull(),
postId: integer("post_id").references(() => Post.id),
authorId: integer("author_id").references(() => Profile.id),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at").notNull().defaultNow(),
replyToId: integer("reply_to_id").references(() => Comment.id),
}}
);