mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 00:05:50 +01:00
move entity hash to entity_changes table WIP
This commit is contained in:
@@ -143,8 +143,7 @@ class Note extends Entity {
|
||||
noteId: this.noteId,
|
||||
content: content,
|
||||
dateModified: dateUtils.localNowDateTime(),
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteId + "|" + content.toString())
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -158,7 +157,9 @@ class Note extends Entity {
|
||||
|
||||
sql.upsert("note_contents", "noteId", pojo);
|
||||
|
||||
entityChangesService.addNoteContentEntityChange(this.noteId);
|
||||
const hash = utils.hash(this.noteId + "|" + content.toString());
|
||||
|
||||
entityChangesService.addEntityChange('note_contents', this.noteId, hash);
|
||||
}
|
||||
|
||||
setJsonContent(content) {
|
||||
@@ -904,10 +905,8 @@ class Note extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
|
||||
Reference in New Issue
Block a user