import { pgTable, primaryKey, timestamp, uuid } from "drizzle-orm/pg-core"; import { comments } from "./comments"; import { users } from "./users"; export const commentLikes = pgTable( "comment_likes", { commentId: uuid("comment_id") .notNull() .references(() => comments.id, { onDelete: "cascade" }), userId: uuid("user_id") .notNull() .references(() => users.uuid, { onDelete: "cascade" }), createdAt: timestamp("created_at", { withTimezone: true }) .notNull() .defaultNow(), }, (t) => ({ pk: primaryKey({ columns: [t.commentId, t.userId] }), }), );