Currently, when I put the @updatedAt directive to a column on my model, it "only" makes the Prisma client update the column with this directive whenever the given model is updated.
However, when I edit the model in Prisma Studio / another Database GUI / or using a different query builder/ORM, the row does not get updated.
The solution could be to generate triggers for the columns with the @updatedAt directive so that no matter the method used to edit the data in the DB the updatedAt column would get updated.
An alternative is to add the triggers to the DB manually
However, when I edit the model in Prisma Studio ... the row does not get updated.
Are you sure about that? Prisma Studio should have the same behavior as using Prisma Client directly.
@tomdohnal Thanks for taking the time to share your suggestion!
createdAt and updatedAt fields are populated by Prisma Client at runtime. Using triggers would be technically possible but has other disadvantages such as database compatibility. This is not something we are considering implementing at this time.
As @janpio indicated, Prisma Studio should also populate these fields with values. If you think this is not working as expected please feel free to open a GH issue in the prisma/prisma repo.