From 69e48ff4d7586651890ce34f1efbe4f35616e835 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 9 Jun 2019 11:16:00 +0200 Subject: [PATCH] fix links table reference --- src/entities/link.js | 2 +- src/services/sync_table.js | 4 ++-- src/services/sync_update.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/entities/link.js b/src/entities/link.js index 51e2c150a..b9c832903 100644 --- a/src/entities/link.js +++ b/src/entities/link.js @@ -19,7 +19,7 @@ const dateUtils = require('../services/date_utils'); * @extends Entity */ class Link extends Entity { - static get entityName() { return "link_map.js"; } + static get entityName() { return "links"; } static get primaryKeyName() { return "linkId"; } static get hashedProperties() { return ["linkId", "noteId", "targetNoteId", "type", "isDeleted", "utcDateCreated", "utcDateModified"]; } diff --git a/src/services/sync_table.js b/src/services/sync_table.js index 110db688f..f5465e234 100644 --- a/src/services/sync_table.js +++ b/src/services/sync_table.js @@ -33,7 +33,7 @@ async function addRecentNoteSync(noteId, sourceId) { } async function addLinkSync(linkId, sourceId) { - await addEntitySync("link_map.js", linkId, sourceId); + await addEntitySync("links", linkId, sourceId); } async function addAttributeSync(attributeId, sourceId) { @@ -101,7 +101,7 @@ async function fillAllSyncRows() { await fillSyncRows("recent_notes", "noteId"); await fillSyncRows("attributes", "attributeId"); await fillSyncRows("api_tokens", "apiTokenId"); - await fillSyncRows("link_map.js", "linkId"); + await fillSyncRows("links", "linkId"); await fillSyncRows("options", "name", 'isSynced = 1'); } diff --git a/src/services/sync_update.js b/src/services/sync_update.js index dcadf6dc8..548675357 100644 --- a/src/services/sync_update.js +++ b/src/services/sync_update.js @@ -28,7 +28,7 @@ async function updateEntity(sync, entity, sourceId) { else if (entityName === 'recent_notes') { await updateRecentNotes(entity, sourceId); } - else if (entityName === 'link_map.js') { + else if (entityName === 'links') { await updateLink(entity, sourceId); } else if (entityName === 'attributes') { @@ -164,7 +164,7 @@ async function updateLink(entity, sourceId) { if (!origLink || origLink.utcDateModified <= entity.utcDateModified) { await sql.transactional(async () => { - await sql.replace("link_map.js", entity); + await sql.replace("links", entity); await syncTableService.addLinkSync(entity.linkId, sourceId); });