neal
neal
DTDrizzle Team
Created by neal on 1/17/2025 in #help
I wonder I don't get reply_to_id in my tables after I migrate and push
it works now with this
import {
AnyPgColumn,// this needs to avoid type ERROR
integer,
pgTable,
serial,
text,
timestamp,
} from "drizzle-orm/pg-core";


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((): AnyPgColumn => Comment.id),
});
import {
AnyPgColumn,// this needs to avoid type ERROR
integer,
pgTable,
serial,
text,
timestamp,
} from "drizzle-orm/pg-core";


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((): AnyPgColumn => Comment.id),
});
2 replies
DTDrizzle Team
Created by neal on 1/16/2025 in #help
I'm receiving error when trying to do a self referencing
I see thanks
3 replies