Serial postgres issue

Anyone have this issue?
> tsx src/lib/db/migrate.ts

⏳ Running migrations...
❌ Migration failed
NeonDbError: db error: ERROR: type "serial" does not exist

Caused by:
ERROR: type "serial" does not exist
> tsx src/lib/db/migrate.ts

⏳ Running migrations...
❌ Migration failed
NeonDbError: db error: ERROR: type "serial" does not exist

Caused by:
ERROR: type "serial" does not exist
Shouldn't serial work? I am doing this
import { varchar, text, boolean, integer, serial, pgTable, uniqueIndex } from "drizzle-orm/pg-core";

export const spaces = pgTable('spaces', {
id: serial("id").primaryKey(),
title: varchar("title", { length: 256 }).notNull(),
description: text("description").notNull(),
active: boolean("active").notNull(),
numberOfMembers: integer("number_of_members").notNull(),
userId: varchar("user_id", { length: 15 }).references(() => users.id, { onDelete: "cascade" }).notNull(),
}, (spaces) => {
return {
titleIndex: uniqueIndex('title_idx').on(spaces.title),
}
});
import { varchar, text, boolean, integer, serial, pgTable, uniqueIndex } from "drizzle-orm/pg-core";

export const spaces = pgTable('spaces', {
id: serial("id").primaryKey(),
title: varchar("title", { length: 256 }).notNull(),
description: text("description").notNull(),
active: boolean("active").notNull(),
numberOfMembers: integer("number_of_members").notNull(),
userId: varchar("user_id", { length: 15 }).references(() => users.id, { onDelete: "cascade" }).notNull(),
}, (spaces) => {
return {
titleIndex: uniqueIndex('title_idx').on(spaces.title),
}
});
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server