postgres error: type "serial" does not exist

I want to migrate my my changes but i get this error: type "serial" does not exist.

This is my schema:

export const likes = pgTable("likes", {
  postId: text("post_id").notNull().primaryKey(),
  authorId: integer("author_id"),
});

export const posts = pgTable("post", {
  id: serial("id").notNull().primaryKey(),
  code: text("content"),
  language: text("content"),
  likes: integer("likes"),
  authorId: integer("author_id")
    .notNull()
    .references(() => users.id),
});

export const users = pgTable("user", {
  id: serial("id").notNull().primaryKey(),
  username: text("username").unique(),
  name: text("name"),
  email: text("email").notNull(),
  emailVerified: timestamp("emailVerified", { mode: "date" }),
  image: text("image"),
});
Was this page helpful?