createInsertSchema wrong type (drizzle-zod 0.3.1, sqlite))

After upgrading to 0.3.1, all of the fields changed to ZodTypeAny
6 Replies
Dan
Dan2y ago
did you update drizzle-orm as well?
tacomanator
tacomanatorOP2y ago
Yes, to 0.24.1
Dan
Dan2y ago
could you post your table definition?
tacomanator
tacomanatorOP2y ago
export const StatusUpdate = sqliteTable("StatusUpdate", { id: cuid2("id").primaryKey(), author: text("author") .notNull() .references(() => User.id), createDate: now("date").notNull(), applicationId: text("applicationId") .notNull() .references(() => Application.id), type: text("type", { enum: statusUpdateTypes }).notNull(), statusDate: text("statusDate").notNull(), note: text("note").notNull(), }); export const statusUpdateInsertSchema = createInsertSchema(StatusUpdate).omit({ id: true, author: true, createDate: true, });
Dan
Dan2y ago
yep, confirmed the issue happens in mysql, too tests were too broad and didn't catch this working on the fix @tacomanator fixed in 0.3.2
tacomanator
tacomanatorOP2y ago
confirmed, thank you!
Want results from more Discord servers?
Add your server