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

After upgrading to 0.3.1, all of the fields changed to ZodTypeAny
6 Replies
bloberenober
bloberenober16mo ago
did you update drizzle-orm as well?
tacomanator
tacomanator16mo ago
Yes, to 0.24.1
bloberenober
bloberenober16mo ago
could you post your table definition?
tacomanator
tacomanator16mo 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, });
bloberenober
bloberenober16mo 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
tacomanator16mo ago
confirmed, thank you!