Next.js Discord

Discord Forum

serial type in psql

Unanswered
astro posted this in #help-forum
Open in Discord
im trying to use serial type for my id column in drizzle schema to enable auto-incremental id, but when migrating the schema it throws error saying type "serial" doesnt exist

import { serial, boolean, text, pgTable } from "drizzle-orm/pg-core";

export const todos = pgTable("todos", {
  id: serial("id").primaryKey(),
  content: text("content").notNull(),
  completed: boolean("completed").default(false).notNull(),
});

0 Replies