Closed
Description
Description and expected behavior
Updating a field of an extended model does not does not update the updatedAt
field of its base
Environment (please complete the following information):
- ZenStack version: 2.14.0
- Prisma version: 6.6.0
- Database type: Neon PostgreSQL
Steps to reproduce
- Visit the sample project at https://sample-todo-nextjs-turbo.vercel.app
- Sign in or create an account
- Create a list
- Add a couple of items to the list
- Connect to the database using SQLPro for Postgres or similar tool using the connection string postgres://default:yBn6QUr2gWfA@ep-billowing-sun-751704-pooler.us-east-1.aws.neon.tech:5432/verceldb?sslmode=require
- Open the User table, find your email address and copy the associated user id
- Execute the following SQL to see the list(s) and todo(s) created (replace [user_id] with yours)
SELECT * FROM "List" RIGHT OUTER JOIN "OwnedItem" ON "List".id = "OwnedItem".id WHERE "OwnedItem"."ownedItemType" = 'List' AND "OwnedItem"."ownerId" = '[user_id]' ORDER BY "OwnedItem"."createdAt" DESC;
SELECT * FROM "Todo" RIGHT OUTER JOIN "OwnedItem" ON "Todo".id = "OwnedItem".id WHERE "OwnedItem"."ownedItemType" = 'Todo' AND "OwnedItem"."ownerId" = '[user_id]' ORDER BY "OwnedItem"."createdAt" DESC;
- Make a note of the
updatedAt
date of one of the todo items - Back in your browser, mark the same item completed
- Rerun the above query
Expected result:
completedAt
and updatedAt
are both updated
Actual result:
completedAt
is updated but updatedAt
is not
NOTE:
- In the repo the base model is at
packages/@erikdakoda/auth/models/ownedItem.zmodel
- The extended List model is at
packages/@erikdakoda/todo/list.zmodel
- The extended Todo model is at
packages/@erikdakoda/todo/todo.zmodel