docs icon indicating copy to clipboard operation
docs copied to clipboard

Test updatedAt and now() in different regions

Open mhwelander opened this issue 5 years ago • 3 comments

Context

(See Jan's comment) Find out what date/time gets written to the database if your db is in a different region.

Suggested action

Update reference docs for that attribute and function.

mhwelander avatar Aug 24 '20 08:08 mhwelander

To set and inform expectations:

  • updatedAt = Prisma functionality
  • @default(now()) = database functionality

janpio avatar Aug 24 '20 18:08 janpio

@janpio We do have docs that state that default(now()) is DB-level but @updatedAt is Prisma-level. Do you think we need more information than that? If so, what specficically?

nikolasburk avatar Mar 13 '24 14:03 nikolasburk

The underlying problem here is that if you have your app and your database in different regions/timezones, updatedAt and now() could lead to different values. As this can be highly confusing, I assume we thought back then that we experimentally confirm this and then add a note to this at appropriate spots.

janpio avatar Mar 13 '24 14:03 janpio