mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 09:56:36 +01:00
Link entity migrated to Attribute, WIP
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user