Skip to content
Discussion options

You must be logged in to vote

Yeah, this is expected, not a bug. @updatedat gets set on every update() call on a model, so your chapter.update() bumps the chapter's updatedAt even though the only thing in data is the nested content upsert. The content row gets its own new timestamp from the upsert, so both move.

If you only want the content timestamp to move, skip the nested write and update the content row directly. Your chapter already holds the content id, so:

const { contentId } = await client.chapter.findUniqueOrThrow({
  where: { id: chapterId },
  select: { contentId: true },
});

const content = await client.chapterContent.upsert({
  where: { id: contentId },
  create: { content, contentHash },
  update: { con…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kasir-barati
Comment options

Answer selected by kasir-barati
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants