Link entity migrated to Attribute, WIP

This commit is contained in:
zadam
2019-08-19 20:12:00 +02:00
parent fd9b79e115
commit 3cb421143f
22 changed files with 172 additions and 174 deletions

View File

@@ -28,9 +28,6 @@ async function updateEntity(sync, entity, sourceId) {
else if (entityName === 'recent_notes') {
await updateRecentNotes(entity, sourceId);
}
else if (entityName === 'links') {
await updateLink(entity, sourceId);
}
else if (entityName === 'attributes') {
await updateAttribute(entity, sourceId);
}
@@ -159,20 +156,6 @@ async function updateRecentNotes(entity, sourceId) {
}
}
async function updateLink(entity, sourceId) {
const origLink = await sql.getRow("SELECT * FROM links WHERE linkId = ?", [entity.linkId]);
if (!origLink || origLink.utcDateModified <= entity.utcDateModified) {
await sql.transactional(async () => {
await sql.replace("links", entity);
await syncTableService.addLinkSync(entity.linkId, sourceId);
});
log.info("Update/sync link " + entity.linkId);
}
}
async function updateAttribute(entity, sourceId) {
const origAttribute = await sql.getRow("SELECT * FROM attributes WHERE attributeId = ?", [entity.attributeId]);