renamed remnants of "sync" to "entity_change"

This commit is contained in:
zadam
2020-12-16 22:17:42 +01:00
parent cdc2721ac1
commit 1cc7917b6e
3 changed files with 68 additions and 61 deletions

View File

@@ -1,6 +1,7 @@
const sql = require('./sql');
const repository = require('./repository');
const sourceIdService = require('./source_id');
const dateUtils = require('./date_utils');
const log = require('./log');
const cls = require('./cls');
@@ -63,8 +64,8 @@ function cleanupEntityChangesForMissingEntities(entityName, entityPrimaryKey) {
FROM entity_changes
WHERE
isErased = 0
AND sync.entityName = '${entityName}'
AND sync.entityId NOT IN (SELECT ${entityPrimaryKey} FROM ${entityName})`);
AND entityName = '${entityName}'
AND entityId NOT IN (SELECT ${entityPrimaryKey} FROM ${entityName})`);
}
function fillEntityChanges(entityName, entityPrimaryKey, condition = '') {
@@ -120,7 +121,13 @@ function fillAllEntityChanges() {
}
module.exports = {
addNoteReorderingEntityChange: (parentNoteId, sourceId) => addEntityChange("note_reordering", parentNoteId, '', sourceId),
addNoteReorderingEntityChange: (parentNoteId, sourceId) => addEntityChange({
entityName: "note_reordering",
entityId: parentNoteId,
hash: 'N/A',
isErased: false,
utcDateChanged: dateUtils.utcNowDateTime()
}, sourceId),
moveEntityChangeToTop,
addEntityChange,
fillAllEntityChanges,