Migration issue with PostgresSQL

I'm trying to migrate
export const postLikeTable = pgTable(
  "post_like",
  {
    postId: text("post_id")
      .references(() => postTable.id, { onDelete: "cascade" })
      .notNull(),
    userId: text("user_id")
      .references(() => userTable.id, { onDelete: "cascade" })
      .notNull(),
  },
  (self) => ({
    pk: primaryKey({ columns: [self.postId, self.userId] }),
  })
);


But it says
PostgresError: foreign key constraint "post_like_post_id_post_id_fk" cannot be implemented code: "42804"
Was this page helpful?