Hi! Is there a way to default to a unix timestamp ...
# orm-help
b
Hi! Is there a way to default to a unix timestamp instead of using now() in your prisma schemas?
a
Since default values can be both function call or static, did you try something like:
Copy code
model mymodel {
  updated_at DateTime  @default(0) @db.Timestamptz(6)
}
(I didn't actually tried this, but seems like it would convert 0 to timestamp so you should endup with a 1970 date)
r
@Brent Leemans 👋 If there’s a function that does this in your database, then your surely do it via dbgenerated.