twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Fix implementation of updatedAt

Open FelixMalfait opened this issue 1 year ago • 2 comments

3 issues:

  1. As of today updatedAt column is not updated when we update the record*
  2. While updatedAt exists on the table it's not visible in the metadata management page of the object and can't be displayed as a column
  3. Bonus (probably hard): touch() parent record when child is updated to reflect it on parent too. Create a separate issue to track this for later if it's not achievable as part of this one

*I'd guess we need to change update-one-query-factory and update-many-query-factory, but tbc if it's correct.

FelixMalfait avatar Dec 18 '23 10:12 FelixMalfait

Hey @FelixMalfait, Can I take this up? Thanks! 😄

  1. As of today updatedAt column is not updated when we update the record*
  2. While updatedAt exists on the table it's not visible in the metadata management page of the object and can't be displayed as a column

I found the fix for this.

Bonus (probably hard): touch() parent record when child is updated to reflect it on parent too. Create a separate issue to track this for later if it's not achievable as part of this one

A little confused here, do you mean if the field we are updating has a parent relation, then that parent schemas updatedAt should be updated too?

AdityaPimpalkar avatar Jan 02 '24 21:01 AdityaPimpalkar

@AdityaPimpalkar nice to see you again! Not many people daring to touch the backend since the refactoring haha

Yes I was thinking of something like this: https://laravel.com/docs/5.3/eloquent-relationships#touching-parent-timestamps

But it might be hard to achieve (no idea) - so feel free to just pass on that, we can always recreate an issue just for this

FelixMalfait avatar Jan 02 '24 21:01 FelixMalfait