Drizzle-Zod extend schema....
My extend schema no longer works "drizzle-orm": "^0.38.3",
"drizzle-zod": "^0.6.1", "drizzle-kit": "^0.30.1",
1 Reply
Base table export const feedbacks = createTable(
"feedback",
{
id: varchar("id", { length: 255 })
.notNull()
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
userId: varchar("userId", { length: 255 })
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
title: varchar("title", { length: 255 }),
message: text("message").notNull(),
label: feedbackLabelEnum("label").notNull(),
status: feedbackStatusEnum("status").default("Open").notNull(),
comment: varchar("comment", { length: 255 }),
...timestamps,
},
(t) => [index("dds_idx_feedback_email").on(t.userId)],
)
Figured out, it does not need the field name anymore. id: (schema) => schema.uuid() [it does not need schema.id.uuid()]