feat(note): save createdAt in a separate column

To keep the createdAt date stable, even when the revisions are dropped,
this adds a separate column
 to store this data separately from revisions.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-02-14 16:59:36 +01:00
parent 342efcd7b7
commit 09ec447069
4 changed files with 10 additions and 6 deletions

View file

@ -405,7 +405,7 @@ export class NotesService {
),
primaryAddress: (await getPrimaryAlias(note)) ?? note.id,
title: note.title ?? '',
createdAt: (await this.getFirstRevision(note)).createdAt,
createdAt: note.createdAt,
description: note.description ?? '',
editedBy: (await this.getAuthorUsers(note)).map((user) => user.username),
permissions: await this.toNotePermissionsDto(note),