refactored "sync" table to "entity_changes"

This commit is contained in:
zadam
2020-08-02 23:27:48 +02:00
parent 5a5ea4f474
commit 864271d5ef
32 changed files with 170 additions and 187 deletions

View File

@@ -102,11 +102,6 @@ class Attribute extends Entity {
}
}
// cannot be static!
updatePojo(pojo) {
delete pojo.__note; // FIXME: probably note necessary anymore
}
createClone(type, name, value, isInheritable) {
return new Attribute({
noteId: this.noteId,

View File

@@ -6,7 +6,7 @@ const protectedSessionService = require('../services/protected_session');
const sql = require('../services/sql');
const utils = require('../services/utils');
const dateUtils = require('../services/date_utils');
const syncTableService = require('../services/sync_table');
const entityChangesService = require('../services/entity_changes.js');
const LABEL = 'label';
const LABEL_DEFINITION = 'label-definition';
@@ -154,7 +154,7 @@ class Note extends Entity {
sql.upsert("note_contents", "noteId", pojo);
syncTableService.addNoteContentSync(this.noteId);
entityChangesService.addNoteContentSync(this.noteId);
}
setJsonContent(content) {

View File

@@ -5,7 +5,7 @@ const protectedSessionService = require('../services/protected_session');
const utils = require('../services/utils');
const sql = require('../services/sql');
const dateUtils = require('../services/date_utils');
const syncTableService = require('../services/sync_table');
const entityChangesService = require('../services/entity_changes.js');
/**
* NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
@@ -126,7 +126,7 @@ class NoteRevision extends Entity {
sql.upsert("note_revision_contents", "noteRevisionId", pojo);
syncTableService.addNoteRevisionContentSync(this.noteRevisionId);
entityChangesService.addNoteRevisionContentSync(this.noteRevisionId);
}
beforeSaving() {