helloworld1_1
helloworld1_1
DTDrizzle Team
Created by helloworld1_1 on 7/22/2024 in #help
Type inference breaking in drizzle-orm 0.32.0 ?
I am trying to update a column called 'isEmailVerified'but TS keeps telling me that 'isEmailVerified' doesn't exist in the schema. Everything used to work fine in the previous version. const updatedUserId: { updatedId: number }[] = await this.db .update(users) .set({ isEmailVerified: true }) .where(eq(users.email, email)) .returning({ updatedId: users.id }); My schema is the following : export const users = pgTable('users', { id: serial('id').primaryKey(), email: varchar('email').unique().notNull(), firstName: varchar('first_name').notNull(), lastName: varchar('last_name').notNull(), password: varchar('password').notNull(), phone: varchar('phone'), roleId: integer('role_id').references(() => userRoles.id), isEmailVerified: boolean('is_email_verified').default(false), createdAt: timestamp('created_at').defaultNow(), }); For some reason, it only sees columns that have 'notNull' constraint.
18 replies