fix: properly store timestamps in versions (#8646)
This PR makes a more clear gap between `version_createdAt` / `version_updatedAt` and `createdAt` / `updatedAt` columns / fields in mongodb. - `createdAt` - This should be a new value in a new version. Before this change it was the same all the time. Should remain the same on autosave. - The same for `updatedAt`, but it should be updated on every change (including autosave) - `version_createdAt` - Should remain equal to `createdAt` from the parent collection / table - `version_updatedAt` - On a latest version it makes sense this be the same as `updatedAt` from the parent collection / table, as all the `version_*` fields should be just synced with it
This commit is contained in:
@@ -99,8 +99,6 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
|
||||
_id: doc.parent,
|
||||
id: doc.parent,
|
||||
...doc.version,
|
||||
createdAt: doc.createdAt,
|
||||
updatedAt: doc.updatedAt,
|
||||
}
|
||||
|
||||
return sanitizeInternalFields(doc)
|
||||
|
||||
Reference in New Issue
Block a user