browntiger
DTDrizzle Team
•Created by browntiger on 12/9/2024 in #help
Drizzle ORM issues
After few hours: it appears that all caused by this .$onUpdate(() => sql(now() AT TIME ZONE 'utc'::text)), just left the index on updatedAt and it breaks. Drizzle-kit 0.30.0
4 replies
DTDrizzle Team
•Created by browntiger on 12/9/2024 in #help
Drizzle ORM issues
My schema export const users = createTable("users", {
id: text("id")
.primaryKey()
.default(sqlgen_random_uuid()),
name: varchar("name", { length: 255 }),
email: varchar("email", { length: 255 }).notNull(),
emailVerified: timestamp("emailVerified", {
mode: "date",
withTimezone: true,
}),
image: varchar("image", { length: 255 }),
password: varchar("password", { length: 100 }),
role: varchar("role", { length: 255 }).default("User").notNull(),
isNewUser: boolean("isNewUser").default(true).notNull(),
invalid_login_attempts: integer("invalid_login_attempts")
.default(0)
.notNull(),
lockedAt: timestamp("lockedAt", {
mode: "date",
withTimezone: true,
}),
isTwoFactorEnabled: boolean("isTwoFactorEnabled").default(false).notNull(),
createdAt: timestamp("created_at", { withTimezone: true, mode: "date" })
.default(sql(now() AT TIME ZONE 'utc'::text))
.notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true, mode: "date" })
.default(sql(now() AT TIME ZONE 'utc'::text))
.notNull()
.$onUpdate(() => sql(now() AT TIME ZONE 'utc'::text)),
})
4 replies
DTDrizzle Team
•Created by browntiger on 12/9/2024 in #help
Drizzle ORM issues
The data was inserted by simple db.insert(users).values(name, email, password)
4 replies