ERROR: User schema updatedAt - Drizzle | Postgres

Helloo! When i add $onUpdate method to my users schema in drizzle pg, i cant to perform any action and i get the following error:
updatedAt: timestamp("updated_at")
.notNull()
.$onUpdate(() => sql`CURRENT_TIMESTAMP`) // this line make conflicts
updatedAt: timestamp("updated_at")
.notNull()
.$onUpdate(() => sql`CURRENT_TIMESTAMP`) // this line make conflicts
# SERVER_ERROR: TypeError: value.toISOString is not a function
at Array.map (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
POST /api/auth/admin/set-role 500
# SERVER_ERROR: TypeError: value.toISOString is not a function
at Array.map (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
POST /api/auth/admin/set-role 500
help please!
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?