createInsertSchema wrong type (drizzle-zod 0.3.1, sqlite))
After upgrading to 0.3.1, all of the fields changed to ZodTypeAny
6 Replies
did you update drizzle-orm as well?
Yes, to 0.24.1
could you post your table definition?
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,
});
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
confirmed, thank you!