mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
move entity hash to entity_changes table WIP
This commit is contained in:
@@ -106,8 +106,7 @@ class NoteRevision extends Entity {
|
||||
const pojo = {
|
||||
noteRevisionId: this.noteRevisionId,
|
||||
content: content,
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteRevisionId + "|" + content)
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -121,15 +120,15 @@ class NoteRevision extends Entity {
|
||||
|
||||
sql.upsert("note_revision_contents", "noteRevisionId", pojo);
|
||||
|
||||
entityChangesService.addNoteRevisionContentEntityChange(this.noteRevisionId);
|
||||
const hash = utils.hash(this.noteRevisionId + "|" + content);
|
||||
|
||||
entityChangesService.addEntityChange('note_revision_contents', this.noteRevisionId, hash);
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
|
||||
Reference in New Issue
Block a user